Skip to content

Commit 481b06a

Browse files
committed
Set serial irq priority from setup()
Previously the interrupt priority of the serial peripheral was only set from Platform_Init() which is only called from the DebugSerial constructor. When constructed as a global, it is possible that the serial driver will overwrite the desired priority. This commit also sets the desired priority from DebugSerial::initSerial() which will be called later from setup() when the DebugSerial object is global. While this doesn't happen for the UART Serial objects, I did hit it when experimenting with USBSerial since it sets its interrupt priority to 1 when I wanted it to be 0.
1 parent e31f49e commit 481b06a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libraries/MRI/src/boards/portenta-h7/DebugSerial.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ void DebugSerial::_initSerial() {
179179

180180
void DebugSerial::initSerial() {
181181
_serial.begin(_baudRate);
182+
setSerialPriority(0);
182183

183184
// Hook communication port ISR to allow debug monitor to be awakened when GDB sends a command.
184185
_commIsr = (IsrFunctionPtr) NVIC_GetVector(_irq);

0 commit comments

Comments
 (0)