int main() { tranzport_t *z; uint8_t status; uint32_t buttons; uint8_t datawheel; int val; z = open_tranzport(); do_lcd(z); for(;;) { do_lcd(z); lights_on(z); do_lcd2(z); lights_off(z); // val = tranzport_read(z, &status, &buttons, &datawheel, 60000); val = -1; if (val < 0) continue; if (status == STATUS_OFFLINE) { printf("offline: "); continue; } if (status == STATUS_ONLINE) { printf("online: "); do_lcd(z); } do_lights(z, buttons); do_buttons(z, buttons, datawheel); } close_tranzport(z); return 0; }
int main(void) { // EXT_MEM_INIT; usart0_init(USART_RS485_SLAVE, 38400); usart0_setprotocol_modbus(); usart1_init(USART_RS232, 115200); USART1_SET_8N1; USART1_RX_INT_DISABLE; timer_init(); kbd_init(); shift_init(); sensor_init(); menu_init(); menu_items_init(); beep_init(); GLOBAL_INT_ENABLE; beep_ms(1000); _delay_ms(500); beep_ms(200); _delay_ms(200); beep_ms(200); _delay_ms(200); lcd_init(); for (;;) { //do_kbd(); do_lcd(); do_shift(); do_sensor(); menu_doitem(); process_usart(); process_soft_controls(); process_siren(); //process_foil(); //process_kbd(); // simple process foil soft_sensors = sensors; if (TEST_SOFT_CONTROL(SOFT_CONTROL_BUNKER_MOTOR) && TEST_SENSOR(SENSOR_END_OF_FOIL)) SOFT_CONTROL_OFF(SOFT_CONTROL_BUNKER_MOTOR); /* if (!TEST_SENSOR(SENSOR_END_OF_FOIL) && TEST_SENSOR(SENSOR_SEC_REEL)) SOFT_CONTROL_ON(SOFT_CONTROL_BUNKER_MOTOR); */ } return 0; }