@@ -327,27 +327,17 @@ void beginUART2()
327327{
328328 rBuffer = (uint8_t *)malloc (settings.gnssHandlerBufferSize );
329329
330- // TODO - For testing, pin to core 1
331- serialGNSS.setRxBufferSize (settings.uartReceiveBufferSize );
332- serialGNSS.setTimeout (settings.serialTimeoutGNSS );
333- serialGNSS.begin (settings.dataPortBaud ); // UART2 on pins 16/17 for SPP. The ZED-F9P will be configured to output NMEA over its UART1 at the same rate.
334-
335- // Reduce threshold value above which RX FIFO full interrupt is generated
336- // Allows more time between when the UART interrupt occurs and when the FIFO buffer overruns
337- // serialGNSS.setRxFIFOFull(50); //Available in >v2.0.5
338- uart_set_rx_full_threshold (2 , 50 ); // uart_num, threshold
330+ if (pinUART2TaskHandle == NULL ) xTaskCreatePinnedToCore (
331+ pinUART2Task,
332+ " UARTStart" , // Just for humans
333+ 2000 , // Stack Size
334+ NULL , // Task input parameter
335+ 0 , // Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest
336+ &pinUART2TaskHandle, // Task handle
337+ 0 ); // Core where task should run, 0=core, 1=Arduino
339338
340- // if (pinUART2TaskHandle == NULL) xTaskCreatePinnedToCore(
341- // pinUART2Task,
342- // "UARTStart", //Just for humans
343- // 2000, //Stack Size
344- // NULL, //Task input parameter
345- // 0, // Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest
346- // &pinUART2TaskHandle, //Task handle
347- // 0); //Core where task should run, 0=core, 1=Arduino
348- //
349- // while (uart2pinned == false) //Wait for task to run once
350- // delay(1);
339+ while (uart2pinned == false ) // Wait for task to run once
340+ delay (1 );
351341}
352342
353343// Assign UART2 interrupts to the core 0. See: https://github.com/espressif/arduino-esp32/issues/3386
0 commit comments