From a54f15bf5ff75f41beaf506423dbf84249e154d3 Mon Sep 17 00:00:00 2001 From: Musa Mahmood Date: Sat, 19 Apr 2025 15:10:13 -0400 Subject: [PATCH] Cleanup debugging ifdefs no longer needed --- main.c | 44 ++++------------------------ pca10056/blank/config/custom_board.h | 4 --- 2 files changed, 5 insertions(+), 43 deletions(-) diff --git a/main.c b/main.c index 20d3af9..2cb6893 100644 --- a/main.c +++ b/main.c @@ -36,7 +36,7 @@ static enum recording_mode_t recording_mode = RECORDING_MODE_DISABLED; ads1298_info_t m_info; #endif -// #TEMP! +// #TEMP: This should be generated dynamically maybe? char g_Peripheral_Info[] = "ADS1298|"; char g_WhoAmI[] = "multimodal_cv_dev0_ecg"; uint8_t g_HWFW_Ver[] = {1,0,0,1}; // HW Maj, HW Min, FW Maj, FW Min @@ -436,22 +436,8 @@ int main(void) { // #TEMP: application_timers_start application_timers_start(); -#if AUTO_START_ADS1298 // for debugging - ads1298_stop_rdatac(); - NRF_LOG_INFO("Writing new ADS1298 registers:"); - uint8_t new_registers[] = {0xC5,0x00,0xCE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,0x00,0x00}; - memcpy(m_info.registers, new_registers, ADS1298_REGISTER_COUNT); - ads1298_update_registers(&m_info); - ads1298_set_data_buffer_length(&m_info); - ads1298_start_rdatac(); - ads1298_wakeup(); - recording_mode = RECORDING_MODE_ALL; -#endif - while (true) { - #if !DISABLE_USBD_IN_MAIN_LOOP while (app_usbd_event_queue_process()) { /* Nothing to do */ } - #endif if (recording_mode == RECORDING_MODE_ALL) { // if (recording_mode & drdy_flag) { // may be faster if we're just using ADS1298 @@ -469,28 +455,13 @@ int main(void) { // :ADS1298_FAST_PATH ads1298_get_data_fast(&m_info); - // switch (m_info.nChs) { - // case 4: - // ads1294_get_data(&m_info); - // break; - // case 6: - // ads1296_get_data(&m_info); - // break; - // case 8: - // ads1298_get_data(&m_info); - // break; - // default: - // break; - // } if (m_info.usb_buffer_count >= m_info.usb_buffer_size_max) { m_info.usb_buffer_count = ADS1298_PACKET_OFFSET; - #if !DISABLE_USBD_IN_MAIN_LOOP app_usbd_cdc_acm_write(&m_app_cdc_acm, m_info.usb_buffer, m_info.usb_buffer_size_max); #if ADS1298_STATS m_info.bytes_sent_usb += m_info.usb_buffer_size_max; #endif - #endif increment_packet(m_info.usb_buffer); // NRF_LOG_INFO("Current time tick: %lu", app_timer_cnt_get()); @@ -498,19 +469,14 @@ int main(void) { } #endif } - #if !DISABLE_USBD_IN_MAIN_LOOP + if (run_throughput_test) { - /*ret = */app_usbd_cdc_acm_write(&m_app_cdc_acm, usb_send_buffer, NRF_DRV_USBD_EPSIZE); + app_usbd_cdc_acm_write(&m_app_cdc_acm, usb_send_buffer, NRF_DRV_USBD_EPSIZE); } - #endif + UNUSED_RETURN_VALUE(NRF_LOG_PROCESS()); + /* Sleep CPU only if there was no interrupt since last loop processing */ - #if !DISABLE_USBD_IN_MAIN_LOOP __WFE(); - #endif } } - -/** @} */ -// size_t size = sprintf(m_tx_buffer, "Hello USB CDC FA demo: %u\r\n", frame_counter); - diff --git a/pca10056/blank/config/custom_board.h b/pca10056/blank/config/custom_board.h index d862c26..61b4231 100644 --- a/pca10056/blank/config/custom_board.h +++ b/pca10056/blank/config/custom_board.h @@ -4,13 +4,9 @@ #define NRF52840_BREAKOUT_BOARD 1 #define ADS1298 1 #if ADS1298 - #define AUTO_START_ADS1298 0 #define ADS1298_STATS 0 #endif -// Debugging flags -#define DISABLE_USBD_IN_MAIN_LOOP 0 - // Testing with nRF52840: #if NRF52840_BREAKOUT_BOARD #define ADS1298_DRDY_PIN 11