int main(void) { for (u32 i = 0; i < 600000; i++) __asm__("nop"); led_setup(); rcc_clock_setup_hse_3v3(&hse_16_368MHz_in_65_472MHz_out_3v3); debug_setup(); printf("\n\nFirmware info - git: " GIT_VERSION ", built: " __DATE__ " " __TIME__ "\n"); printf("--- DEBUG TEST ---\n"); debug_register_callback(0x22, &foo_callback, &foo_callback_node); debug_register_callback(0x42, &led_callback, &led_callback_node); while(1) { debug_process_messages(); for (u32 i = 0; i < 600000; i++) __asm__("nop"); } while (1); return 0; }
int main(void) { for (u32 i = 0; i < 600000; i++) __asm__("nop"); led_setup(); rcc_clock_setup_hse_3v3(&hse_16_368MHz_in_65_472MHz_out_3v3); debug_setup(); timer_setup(); // Debug pins (CC1111 TX/RX) RCC_AHB1ENR |= RCC_AHB1ENR_IOPCEN; gpio_mode_setup(GPIOC, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO10|GPIO11); gpio_clear(GPIOC, GPIO10|GPIO11); printf("\n\nFirmware info - git: " GIT_VERSION ", built: " __DATE__ " " __TIME__ "\n"); printf("--- DEBUG RX STRESS TEST ---\n"); static msg_callbacks_node_t callback_node; debug_register_callback(0x22, &callback, &callback_node); for (u8 i=0; i<30; i++) { guard_below[i] = 0; guard_above[i] = 0; } while(1) { /* Check the guards for buffer over/underrun. */ for (u8 i=0; i<30; i++) { if (guard_below[i] != 0) screaming_death(); if (guard_above[i] != 0) screaming_death(); } debug_process_messages(); //for (u32 i = 0; i < 1000; i++) // __asm__("nop"); } while (1); return 0; }