Issues
The following issues lead to warnings or errors when compiling with MSP430-GCC:
__dma_copy function in fram.h is never defined, and never used. __dma_word_copy is defined and used but not declared anywhere, not even as extern.
- GCC complains about invalid (implicit) casts when using the
__dma_word_copy function.
- Linker errors occur because functions are defined as inline in the header files
isrmanager.h and scheduler.h.
- In
__pers_timer_init, undefined behaviour occurs because arrays are written out of bounds. The same happens in unpack_pdc_to_local
- The
set_timer function in clk.h is unused and not declared, which leads to a warning.
Solutions
The following solutions for the issues mentioned above have been verified as working with MSP430-GCC:
- Change the function name in
fram.h to __dma_word_copy and include fram.h in dma.c. Then also include fram.h in thread.c.
- Change the return type of
__dma_word_copy to void *, and cast to uintptr_t instead of unsigned long.
- Remove the inline keywords in the header files.
- Split the for loop into 3 loops, one for each timer array.
- Replace
MAX_TIMER_THREADS with MAX_PDC_THREADS.
- Remove the
set_timer function.