I am looking to create a code patch to allow the enabling of half duplex mode in USART1. It just requires calling the following function in the chip drivers (this will work for both the Photon and the Core):
USART_HalfDuplexCmd(USART_TypeDef* USARTx, FunctionalState NewState);
Adding this to the 0.3.4 firmware was easy. I am just struggling with where to put this in the 0.4.x firmware. It looks like I might have to put it into both hal/src/core/usart_hal.c and hal/src/stm32f2xx/usart_hal.c, as I don’t know if I can get at the USART_TypeDef* that I need in wiring/src/spark_wiring_usartserial.cpp.
I am definitely going to have to put something into wiring/src/spark_wiring_usartserial.cpp so that it can be enabled from user space, I think I may have to call something in the HAL.
Since the code will be identical between the Core and the Photon is there a single place I could put it, or am I going to have to put it in both?
Or am I totally off base and is there a better place to put it?