// ============================================================================= // Entry point. // // Besides ordinary RESET sources, can be invoked directly by admin handler. // In that case, the interrupts are disabled, so they need to be enabled. // TODO: investigate brown-out behaviour (are ports re-initialized?) // NOTE: possible optimization: // Ext I/O registers (e.g. USART) accessed with lds/sts. // ============================================================================= int main(void) { // if (kernel__mode__is_set()) { // application__stop(); // } // else { kernel__init(); kernel__start(); application__init(); application__start(); // } sei(); // run background tasks for(;;) { cli(); comm_service__notifications__1__run(); sei(); _delay_us(1); } // console__run(); return 0; }
int main(void) { application__init(); application__start(); #if !defined(__AVR_ARCH__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wmissing-noreturn" #endif for(;;) { uint8_t c = usart0__in__read(); soft_spi0__write(c); } #if !defined(__AVR_ARCH__) #pragma clang diagnostic pop #endif #if !defined(__AVR_ARCH__) #pragma clang diagnostic push #pragma ide diagnostic ignored "OCDFAInspection" #endif return 0; #if !defined(__AVR_ARCH__) #pragma clang diagnostic pop #endif }
int main(void) { application__init(); application__start(); led_a__init(); led_b__init(); sei(); #if !defined(__AVR_ARCH__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wmissing-noreturn" #endif for(;;) { if (twi__slave__handler__is_runnable()) { led_a__set(1); twi__slave__handler__run(); led_a__set(0); } } #if !defined(__AVR_ARCH__) #pragma clang diagnostic pop #endif #if !defined(__AVR_ARCH__) #pragma clang diagnostic push #pragma ide diagnostic ignored "OCDFAInspection" #endif return 0; #if !defined(__AVR_ARCH__) #pragma clang diagnostic pop #endif }
int main(void) { application__init(); application__start(); #if !defined(__AVR_ARCH__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wmissing-noreturn" #endif for(;;) { led1__set(button1__get()); led2__set(button2__get()); led3__set(button3__get()); led4__set(button4__get()); led5__set(button5__get()); led6__set(button6__get()); } #if !defined(__AVR_ARCH__) #pragma clang diagnostic pop #endif #if !defined(__AVR_ARCH__) #pragma clang diagnostic push #pragma ide diagnostic ignored "OCDFAInspection" #endif return 0; #if !defined(__AVR_ARCH__) #pragma clang diagnostic pop #endif }
int main(void) { application__init(); application__start(); #if !defined(__AVR_ARCH__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wmissing-noreturn" #endif for(;;) { // if (twi__slave__thread__is_runnable()) { // } } #if !defined(__AVR_ARCH__) #pragma clang diagnostic pop #endif #if !defined(__AVR_ARCH__) #pragma clang diagnostic push #pragma ide diagnostic ignored "OCDFAInspection" #endif return 0; #if !defined(__AVR_ARCH__) #pragma clang diagnostic pop #endif }
int main(void) { application__init(); _delay_us(2); application__start(); sei(); #if !defined(__AVR_ARCH__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wmissing-noreturn" #endif for(;;) { keyboard__run(); } #if !defined(__AVR_ARCH__) #pragma clang diagnostic pop #endif #if !defined(__AVR_ARCH__) #pragma clang diagnostic push #pragma ide diagnostic ignored "OCDFAInspection" #endif return 0; #if !defined(__AVR_ARCH__) #pragma clang diagnostic pop #endif }
int main(void) { application__init(); application__start(); for(;;) { } return 0; }
int main(void) { MCUSR &= ~_BV(WDRF); wdt_disable(); application__init(); application__start(); sei(); for(;;); return 0; }
int main(void) { _delay_ms(50); application__init(); PORTA = 0; PORTB = 0; PORTC = 0; PORTD = 0; if (pin_number > 0x1F) pin_number = 0; switch (pin_number++) { case 0x00: PORTD |= (1<<0); break; case 0x01: PORTD |= (1<<1); break; case 0x02: PORTD |= (1<<2); break; case 0x03: PORTD |= (1<<3); break; case 0x04: PORTD |= (1<<4); break; case 0x05: PORTD |= (1<<5); break; case 0x06: PORTD |= (1<<6); break; case 0x07: PORTD |= (1<<7); break; case 0x08: PORTB |= (1<<0); break; case 0x09: PORTB |= (1<<1); break; case 0x0A: PORTB |= (1<<2); break; case 0x0B: PORTB |= (1<<3); break; case 0x0C: PORTB |= (1<<4); break; case 0x0D: PORTB |= (1<<5); break; case 0x0E: PORTB |= (1<<6); break; case 0x0F: PORTB |= (1<<7); break; case 0x10: PORTC |= (1<<0); break; case 0x11: PORTC |= (1<<1); break; case 0x12: PORTC |= (1<<2); break; case 0x13: PORTC |= (1<<3); break; case 0x14: PORTC |= (1<<4); break; case 0x15: PORTC |= (1<<5); break; case 0x16: PORTC |= (1<<6); break; case 0x17: PORTC |= (1<<7); break; case 0x18: PORTA |= (1<<0); break; case 0x19: PORTA |= (1<<1); break; case 0x1A: PORTA |= (1<<2); break; case 0x1B: PORTA |= (1<<3); break; case 0x1C: PORTA |= (1<<4); break; case 0x1D: PORTA |= (1<<5); break; case 0x1E: PORTA |= (1<<6); break; case 0x1F: PORTA |= (1<<7); break; } while (1); }
// ============================================================================= // Entry point. // ============================================================================= int main(void) { application__init(); application__start(); sei(); // run background tasks for(;;) { } return 0; }
int main(void) { application__init(); application__start(); _delay_ms(500); cli(); if (tx_ring_buffer__is_writable()) { tx_ring_buffer__put('>'); } if (tx_ring_buffer__is_writable()) { tx_ring_buffer__put('\r'); } if (tx_ring_buffer__is_writable()) { tx_ring_buffer__put('\n'); } sei(); #if !defined(__AVR_ARCH__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wmissing-noreturn" #endif for(;;) { led1__toggle(); _delay_ms(1000); led1__toggle(); _delay_ms(1000); // if (twi__slave__thread__is_runnable()) { // } } #if !defined(__AVR_ARCH__) #pragma clang diagnostic pop #endif #if !defined(__AVR_ARCH__) #pragma clang diagnostic push #pragma ide diagnostic ignored "OCDFAInspection" #endif return 0; #if !defined(__AVR_ARCH__) #pragma clang diagnostic pop #endif }