void LedManager::InitLeds() { pinMode(HEADLIGHT, OUTPUT); pinMode(LANDING, OUTPUT); LandingOff(); UpdateHeadlight(0); pinMode(L1R, OUTPUT); pinMode(L1B, OUTPUT); pinMode(L1G, OUTPUT); pinMode(L2R, OUTPUT); pinMode(L2B, OUTPUT); pinMode(L2G, OUTPUT); pinMode(L3R, OUTPUT); pinMode(L3B, OUTPUT); pinMode(L3G, OUTPUT); pinMode(L4R, OUTPUT); pinMode(L4B, OUTPUT); pinMode(L4G, OUTPUT); UpdateLeds(); }
void DriverUpdateInit(void) { /* stc_params_control_t *pvReturn; pvReturn = (stc_params_control_t*)malloc( sizeof(stc_params_control_t)*5 ); pvReturn[0].value = 12.3; */ Button_Init(ButtonCallback); InitLedDriver(); // dataLED.stc_w.leds = 0xFFFFFFFF; dataLED.stc_w.backlight[0] = 0xFF; dataLED.stc_w.backlight[1] = 0xFF; dataLED.stc_w.backlight[2] = 0xFF; dataLED.stc_w.backlight[3] = 0xFF; dataLED.stc_w.backlight[4] = 0xFF; dataLED.stc_w.backlight[5] = 0xFF; UpdateLeds(); SetValueBacklight(100); /* m_unTime.stcTimeFields.u8Hours = 12; m_unTime.stcTimeFields.u8Minutes = 0; m_unTime.stcTimeFields.u8Seconds = 0; m_unTime.stcTimeFields.u8Year = 0; m_unTime.stcTimeFields.u8Month = 12; m_unTime.stcTimeFields.u8Day = 24; if (RtcExt_Init(&m_unTime, RTC_EXT_CTRL_REG_SQWE | RTC_EXT_CTRL_REG_RS_32KHZ768) == Ok) { Uart_WriteString("RTC init\r\n", TRUE); } else { Uart_WriteString("RTC init errorr\r\n", TRUE); } */ Timer_Start(TIMER_ID_MAIN, 100, TRUE, UpdateSMC); Timer_Start(TIMER_500MS, 500, TRUE, Timer_500ms); Timer_Start(TIMER_1S, 1000, TRUE, Timer_1s); Timer_Start(TIMER_60S, 60000, TRUE, Timer_60s); // Init graphical interface Hmi_Init(); }
static int kb_special(uchar key) { static bool specKeyUp = true; switch(key) { case 0x36: //R-Shift down case 0x2A: //L-Shift down shift = true; break; case 0xB6: //R-Shift up case 0xAA: //L-Shift up shift = false; break; case 0x1D: //Control down ctrl = true; break; case 0x9D: //Control up ctrl = false; break; case 0x38: //Alt down alt = true; break; case 0xB8: //Alt up alt = false; break; case 0x3A: //Caps down if(specKeyUp == true) { caps = !caps; UpdateLeds(CapsLock); specKeyUp = false; } break; case 0x45: //Num down if(specKeyUp == true) { num = !num; UpdateLeds(NumLock); specKeyUp = false; } break; case 0x46: //Scroll down if(specKeyUp == true) { num = !num; UpdateLeds(ScrollLock); specKeyUp = false; } break; case 0x3B: //F1 Down if(specKeyUp && FKey[0].enabled) { FKey[0].func(); specKeyUp = false; } break; case 0x3C: //F2 Down if(specKeyUp && FKey[1].enabled) { FKey[1].func(); specKeyUp = false; } break; case 0x3D: //F3 Down if(specKeyUp && FKey[2].enabled) { FKey[2].func(); specKeyUp = false; } break; case 0x3E: //F4 Down if(specKeyUp && FKey[3].enabled) { FKey[3].func(); specKeyUp = false; } break; case 0x3F: //F5 Down if(specKeyUp && FKey[4].enabled) { FKey[4].func(); specKeyUp = false; } break; case 0x40: //F6 Down if(specKeyUp && FKey[5].enabled) { FKey[5].func(); specKeyUp = false; } break; case 0x41: //F7 Down if(specKeyUp && FKey[6].enabled) { FKey[6].func(); specKeyUp = false; } break; case 0x42: //F8 Down if(specKeyUp && FKey[7].enabled) { FKey[7].func(); specKeyUp = false; } break; case 0x43: //F9 Down if(specKeyUp && FKey[8].enabled) { FKey[8].func(); specKeyUp = false; } break; case 0x44: //F10 Down if(specKeyUp && FKey[9].enabled) { FKey[9].func(); specKeyUp = false; } break; case 0xBA: //Caps Up case 0xBB: //F1 Up case 0xBC: //F2 Up case 0xBD: //F3 Up case 0xBE: //F4 Up case 0xBF: //F5 Up case 0xC0: //F6 Up case 0xC1: //F7 Up case 0xC2: //F8 Up case 0xC3: //F9 Up case 0xC4: //F10 Up case 0xC5: //Num Up case 0xC6: //Scroll Up specKeyUp = true; break; case 0xE0: break; default: return(0); } return (1); }