예제 #1
0
// interrupt handler for uart
// __attribute__((__interrupt__))
static void irq_usart(void) {
#if 1
#else
  serial_process();
  // usart_write_char(FTDI_USART,c);
  // print_dbg("\r\nusb cable change.");
  gpio_toggle_pin(LED_MODE_PIN);
#endif
}
예제 #2
0
int main(void)
{
    wdt_disable();
    /* Clear WDRF in MCUSR */
    MCUSR &= ~(1<<WDRF);
    /* Write logical one to WDCE and WDE */
    /* Keep old prescaler setting to prevent unintentional time-out */
    WDTCSR |= (1<<WDCE) | (1<<WDE);
    /* Turn off WDT */
    WDTCSR = 0x00;
    //DDRA |= 0x07;
    //PORTA &= ~7;
    //DDRC |= 0x07;
    //DDRC |= 0xC0;

    eeprom_read_block(&state, &state_ee, sizeof(state));
    aes_handler_init();
    bus_handler_init();
    serial_init();
    bus_init();
    cmd_init();
    buttons_init();
    leds_init();
    timer0_init();
    sei();
    
    leds_set(0,LED_SHORT_FLASH);

    while( 1 ){
        if( timer0_timebase ){
            timer0_timebase--;
            bus_tick();
            serial_tick();
            buttons_tick();
            leds_tick();
        }
        bus_process();
        serial_process();

        //aes128_enc(data, &ctx); /* encrypting the data block */
    }

}
예제 #3
0
static void handle_Serial(s32 data) {
  serial_process(data);
}