Example #1
0
int main(void) {
    rts__init();
    rts__set(1);

    uint8_t counter = 0;
    uint8_t c = 'a';

    // display
    display__init();
    display__render_packed(0);

    USART0_REG_C |= (1<<usart0__stop_bits__BIT);
    usart0__rate__set(USART0__BAUD_RATE);
    usart0__tx__enabled__set(1);    

    for(;;) {
        usart0__out__write(c++);
        loop_until_bit_is_set(usart0__tx__complete__value__HOST, usart0__tx__complete__value__BIT);
        if (c == ('z' + 1)) {
            usart0__out__write(13);
            loop_until_bit_is_set(usart0__tx__complete__value__HOST, usart0__tx__complete__value__BIT);
            usart0__out__write(10);
            loop_until_bit_is_set(usart0__tx__complete__value__HOST, usart0__tx__complete__value__BIT);
 
            c = 'a';
            _delay_ms(1000);
            display__render_packed(++counter);
        }
    }

    return 0;
}
Example #2
0
int main(void) {
    display__init();

    rts__init();
    rts__set(1);

    usart0__rate__set(USART0__BAUD_RATE);
    usart0__tx__enabled__set(1);

//    FILE usart_out = FDEV_SETUP_STREAM(usart_putchar, NULL, _FDEV_SETUP_WRITE);
//    stdout = &usart_out;

    onewire__bus__init();

    // sleeping
    set_sleep_mode(SLEEP_MODE_IDLE);
    sleep_enable();

    display__init();

    sei();

#if !defined(__AVR_ARCH__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmissing-noreturn"
#endif
    for(;;) {
        main__thread__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
    return 0;
}