void auto_init(void) { #ifdef MODULE_BOARD_DISPLAY extern void lcd_init(); lcd_init(); DEBUG("DISP OK"); #endif #ifdef MODULE_DISPLAY_PUTCHAR extern void init_display_putchar(); init_display_putchar(); DEBUG("DISP OK"); #endif #ifdef MODULE_HWTIMER DEBUG("Auto init hwtimer module.\n"); hwtimer_init(); #endif #ifdef MODULE_VTIMER DEBUG("Auto init vtimer module.\n"); vtimer_init(); #endif #ifdef MODULE_UART0 DEBUG("Auto init uart0 module.\n"); board_uart0_init(); #endif #ifdef MODULE_RTC DEBUG("Auto init rtc module.\n"); rtc_init(); rtc_enable(); #endif #ifdef MODULE_SHT11 DEBUG("Auto init SHT11 module.\n"); sht11_init(); #endif #ifdef MODULE_GPIOINT DEBUG("Auto init gpioint module.\n"); gpioint_init(); #endif #ifdef MODULE_CC110X DEBUG("Auto init CC1100 module.\n"); cc1100_init(); #endif #ifdef MODULE_LTC4150 DEBUG("Auto init ltc4150 module.\n"); ltc4150_init(); #endif #ifdef MODULE_MCI DEBUG("Auto init mci module.\n"); MCI_initialize(); #endif #ifdef MODULE_PROFILING extern void profiling_init(void); profiling_init(); #endif main(); }
int main(void) { board_uart0_init(); posix_open(uart0_handler_pid, 0); shell_t shell; shell_init(&shell, shell_commands, SHELL_BUFSIZE, shell_readc, shell_putchar); puts("`struct tm` utility shell."); shell_run(&shell); return 0; }
int main(void) { printf("test_shell.\n"); board_uart0_init(); posix_open(uart0_handler_pid, 0); shell_t shell; shell_init(&shell, shell_commands, shell_readc, shell_putchar); shell_run(&shell); return 0; }
int main(void) { shell_t shell; puts("Test for the low-level I2C driver"); #ifndef MODULE_NEWLIB /* prepare I/O for shell */ board_uart0_init(); (void) posix_open(uart0_handler_pid, 0); shell_init(&shell, shell_commands, UART0_BUFSIZE, uart0_readc, uart0_putc); #else shell_init(&shell, shell_commands, UART0_BUFSIZE, getchar, putchar); #endif /* define own shell commands */ shell_run(&shell); return 0; }
int main(void) { printf("test_shell.\n"); board_uart0_init(); posix_open(uart0_handler_pid, 0); /* define own shell commands */ shell_t shell; shell_init(&shell, shell_commands, SHELL_BUFSIZE, shell_readc, shell_putchar); shell_run(&shell); /* or use only system shell commands */ /* shell_t sys_shell; shell_init(&sys_shell, NULL, SHELL_BUFSIZE, shell_readc, shell_putchar); shell_run(&sys_shell); */ return 0; }
int main(void) { (RCC->AHBENR |= RCC_AHBENR_GPIOAEN); (RCC->AHBENR |= RCC_AHBENR_GPIOBEN); // initialize ringbuffer for received packets packet_queue_init(); switch_init(); led_init(); board_uart0_init(); //uart_init wird von syscalls schon vorher aufgerufen - hoffentlich zumindest //<just for debug> // GPIO_9 SW1 // GPIO_10 SW2 // GPIO_11 SW4 // GPIO_12 nRF-IRQ gpio_init_int(GPIO_9, GPIO_PULLDOWN, GPIO_FALLING, (void *)test, 0); //wird extern auf high gezogen gpio_irq_enable(GPIO_9); led1_on(); // </just for debug> // initialize radio driver radio_nrf_init(); radio_nrf_register_rx_callback(packet_received); //eeprom_init(); // TODO get node address from eeprom // if not available, go through algorithm to determine new address: // 1. generate randomly address of length 11 bit // 2. send PING with generated address // 3. wait X seconds for answer (ping_answer) // 4. if no answer received, accept address and save it // 5. if an answer is received, start over with 1. // (or determine another address on another way) // while (1) { // we can go to sleep here // THIS DOES NOT WAKE UP! // (if needed, thread has to be woken up externally) thread_sleep(); } return 0; }