fiexed a error in the workshop file

This commit is contained in:
schneider 2012-05-01 11:23:22 +08:00
parent 132b11a47a
commit 96bd0abbbd
1 changed files with 18 additions and 2 deletions

View File

@ -133,6 +133,24 @@ static void lkReadI2C() {
lk_in1 = lkGetI2C(LK_I2C_CR_INPUT1); lk_in1 = lkGetI2C(LK_I2C_CR_INPUT1);
} }
static void lksetLED(uint8_t led, uint8_t state)
{
uint8_t reg;
if( led < 4 ){
reg = LK_I2C_CR_LS0;
}else if( led < 8 ){
reg = LK_I2C_CR_LS1;
}else if( led < 12 ){
reg = LK_I2C_CR_LS2;
}else{
reg = LK_I2C_CR_LS3;
}
lkSetI2C(reg, state << (led*2));
}
static void tick_lilakit(void) static void tick_lilakit(void)
{ // every 10ms { // every 10ms
lk_ticks++; lk_ticks++;
@ -145,8 +163,6 @@ static void tick_lilakit(void)
lkReadI2C(); lkReadI2C();
if ((lk_in0 & 0x02) == 0 && lk_button_mode == 0) { if ((lk_in0 & 0x02) == 0 && lk_button_mode == 0) {
melody_index = 0;
melody_timeout = 0;
lk_ticks = 0; lk_ticks = 0;
lk_button_mode = 1; lk_button_mode = 1;