Cleanup debugging ifdefs no longer needed
This commit is contained in:
parent
0fcbbf06bf
commit
a54f15bf5f
44
main.c
44
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,27 +455,12 @@ 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);
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user