void bootstrap() { #ifdef HAS_LCD lcd_write_string("NOISE"); #endif #if NUM_USERBUTTONS > 1 ubutton_register_callback(0, &userbutton_callback); ubutton_register_callback(1, &userbutton_callback); #endif prepare_channel_indexes(); hw_radio_init(NULL, NULL); fifo_init(&uart_rx_fifo, uart_rx_buffer, sizeof(uart_rx_buffer)); console_set_rx_interrupt_callback(&uart_rx_cb); console_rx_interrupt_enable(true); sched_register_task(&read_rssi); sched_register_task(&start_rx); sched_register_task(&process_uart_rx_fifo); timer_post_task_delay(&start_rx, TIMER_TICKS_PER_SEC * 3); sched_register_task((&execute_sensor_measurement)); timer_post_task_delay(&execute_sensor_measurement, TEMPERATURE_PERIOD); measureTemperature(); }
void bootstrap() { DPRINT("Device booted at time: %d\n", timer_get_counter_value()); // TODO not printed for some reason, debug later id = hw_get_unique_id(); hw_radio_init(&alloc_new_packet, &release_packet); rx_cfg.channel_id = current_channel_id; tx_cfg.channel_id = current_channel_id; ubutton_register_callback(0, &userbutton_callback); ubutton_register_callback(1, &userbutton_callback); fifo_init(&uart_rx_fifo, uart_rx_buffer, sizeof(uart_rx_buffer)); uart_set_rx_interrupt_callback(&uart_rx_cb); uart_rx_interrupt_enable(true); sched_register_task(&start_rx); sched_register_task(&transmit_packet); sched_register_task(&start); sched_register_task(&process_uart_rx_fifo); current_state = STATE_CONFIG_DIRECTION; sched_post_task(&start); sched_post_task(&process_uart_rx_fifo); }
void bootstrap() { DPRINT("Device booted at time: %d\n", timer_get_counter_value()); #ifndef FRAMEWORK_LOG_BINARY console_print("\r\nPER TEST - commands:\r\n"); console_print(" CHANfffriii channel settings:\r\n"); console_print(" fff frequency : 433, 868, 915\r\n"); console_print(" r rate : L(ow) N(ormal) H(igh)\r\n"); console_print(" iii center_freq_index\r\n"); console_print(" TRANsss transmit a packet every sss seconds.\r\n"); console_print(" RECV receive packets\r\n"); console_print(" RSET reset module\r\n"); #endif id = hw_get_unique_id(); hw_radio_init(&alloc_new_packet, &release_packet); rx_cfg.channel_id = current_channel_id; tx_cfg.channel_id = current_channel_id; ubutton_register_callback(0, &userbutton_callback); ubutton_register_callback(1, &userbutton_callback); fifo_init(&uart_rx_fifo, uart_rx_buffer, sizeof(uart_rx_buffer)); console_set_rx_interrupt_callback(&uart_rx_cb); console_rx_interrupt_enable(); sched_register_task(&start_rx); sched_register_task(&transmit_packet); sched_register_task(&start); sched_register_task(&process_uart_rx_fifo); current_state = STATE_CONFIG_DIRECTION; sched_post_task(&start); sched_post_task(&process_uart_rx_fifo); #ifdef PLATFORM_EFM32GG_STK3700 #else char str[20]; channel_id_to_string(¤t_channel_id, str, sizeof(str)); lcd_write_line(6, str); #endif timer_post_task(&transmit_packet, TIMER_TICKS_PER_SEC * 1); }
void bootstrap() { led_on(0); led_on(1); log_print_string("Device booted at time: %d\n", timer_get_counter_value()); console_print("Device Booted\r\n"); sched_register_task(&led_on_callback); sched_register_task(&led_off_callback); sched_register_task(&timer1_callback); timer_post_task_delay(&led_on_callback, TIMER_TICKS_PER_SEC); //timer_post_task_delay(&timer1_callback, 0x0000FFFF + (uint32_t)100); #if PLATFORM_NUM_BUTTONS > 0 int i= 0; for (i=0;i<PLATFORM_NUM_BUTTONS;i++) { ubutton_register_callback(i, &userbutton_callback); } #endif led_off(0); led_off(1); }
void bootstrap() { DPRINT("Device booted at time: %d\n", timer_get_counter_value()); // TODO not printed for some reason, debug later #ifdef HAS_LCD lcd_write_string("cont tx"); #endif switch(current_channel_class) { // TODO only 433 for now case PHY_CLASS_NORMAL_RATE: channel_count = NORMAL_RATE_CHANNEL_COUNT; realloc(channel_indexes, channel_count); for(int i = 0; i < channel_count; i++) channel_indexes[i] = i * 8; break; case PHY_CLASS_LO_RATE: channel_count = LO_RATE_CHANNEL_COUNT; realloc(channel_indexes, channel_count); for(int i = 0; i < channel_count; i++) channel_indexes[i] = i; break; } #if NUM_USERBUTTONS > 1 ubutton_register_callback(0, &userbutton_callback); ubutton_register_callback(1, &userbutton_callback); #endif hw_radio_init(NULL, NULL); sched_register_task(&start); timer_post_task_delay(&start, TIMER_TICKS_PER_SEC * 5); }
void bootstrap() { led_on(0); led_on(1); log_print_string("Device booted at time: %d\n", timer_get_counter_value()); sched_register_task(&led_on_callback); sched_register_task(&led_off_callback); sched_register_task(&timer1_callback); timer_post_task_delay(&led_on_callback, TIMER_TICKS_PER_SEC); timer_post_task_delay(&timer1_callback, 0x0000FFFF + (uint32_t)100); #if NUM_USERBUTTONS > 0 ubutton_register_callback(0, &userbutton_callback); ubutton_register_callback(1, &userbutton_callback); #endif led_off(0); led_off(1); }
void bootstrap() { DPRINT("Device booted at time: %d\n", timer_get_counter_value()); // TODO not printed for some reason, debug later #ifdef HAS_LCD lcd_write_string("cont TX \n"); #endif switch(current_channel_class) { case PHY_CLASS_NORMAL_RATE: channel_count = NORMAL_RATE_CHANNEL_COUNT; realloc(channel_indexes, channel_count); for(int i = 0; i < channel_count; i++) channel_indexes[i] = i * 8; break; case PHY_CLASS_LO_RATE: channel_count = LO_RATE_CHANNEL_COUNT; realloc(channel_indexes, channel_count); for(int i = 0; i < channel_count; i++) channel_indexes[i] = i; break; } #if PLATFORM_NUM_BUTTONS > 1 ubutton_register_callback(0, &userbutton_callback); ubutton_register_callback(1, &userbutton_callback); #endif hw_radio_init(&alloc_packet_callback, &release_packet_callback); sched_register_task(&start); timer_post_task_delay(&start, 500); }