int main(void) { halInit(); chSysInit(); initLed(); setLeds( 7 ); initRead(); initWrite(); initI2c(); initUsb(); /*IWDGConfig cfg; cfg.div = IWDG_DIV_256; cfg.counter = (40000 / 256 / 2 ); iwdgInit(); iwdgStart( &IWDGD, &cfg ); iwdgReset( &IWDGD );*/ while (TRUE) { //iwdgReset( &IWDGD ); processShell(); chThdSleepMilliseconds( 250 ); } return 0; }
void test_i2c(void) { initI2c(I2C_BUS_DEVICE); writeConfig(BUTTONS3_ADDR, 0xCF); writeOutputs(BUTTONS3_ADDR, 0x00); delay(500); writeOutputs(BUTTONS3_ADDR, 0x30); }