Severson-Group / AMDC-Firmware

Embedded system code (C and Verilog) which runs the AMDC Hardware
http://docs.amdc.dev/firmware
BSD 3-Clause "New" or "Revised" License
30 stars 5 forks source link

Requesting data from invalid AMDS devices for REV D hardware target #306

Closed npetersen2 closed 12 months ago

npetersen2 commented 1 year ago

Per @DivyaMendpara, she found that when building the app_cpu1 project for REV D hardware with AMDS support and auto TX data enabled, the build fails.

Here is the issue:

https://github.com/Severson-Group/AMDC-Firmware/blob/4dcb288f51b6879c003468ef5844b102ed3c6372/sdk/app_cpu1/common/sys/scheduler.c#L217-L226

AMDS devices 2-4 are only available on REV E, so this should have a ifdef:

#if USER_CONFIG_ENABLE_MOTHERBOARD_AUTO_TX == 1
        // Request motherboard to send its latest ADC sample data back to the AMDC
        //
        // NOTE: this is specifically before the while loop below so that the new
        // data arrives before it is needed in the next control loop.
        motherboard_request_new_data(MOTHERBOARD_1_BASE_ADDR);

#if USER_CONFIG_HARDWARE_TARGET == AMDC_REV_E
        motherboard_request_new_data(MOTHERBOARD_2_BASE_ADDR);
        motherboard_request_new_data(MOTHERBOARD_3_BASE_ADDR);
        motherboard_request_new_data(MOTHERBOARD_4_BASE_ADDR);
#endif 
#endif
DivyaMendpara commented 1 year ago

Hello @npetersen2 , adding the #ifdef statement in code was able to fix the issue