From df5b6b7eaa7a31d53e3c411bd4fc8f5b5835e87c Mon Sep 17 00:00:00 2001 From: Grzegorz Gajoch Date: Sun, 15 Mar 2020 02:02:07 +0000 Subject: [PATCH] Fix compilation errors --- main/ctrl.cpp | 8 ++++---- main/gps.cpp | 1 + main/hal.cpp | 3 +-- main/rfm.h | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/main/ctrl.cpp b/main/ctrl.cpp index c588f79..bfea6a0 100644 --- a/main/ctrl.cpp +++ b/main/ctrl.cpp @@ -508,12 +508,12 @@ void vTaskCTRL(void* pvParameters) xSemaphoreTake(CONS_Mutex, portMAX_DELAY); if(TimeChange) { Format_String(CONS_UART_Write, "TimeChange: "); - Format_SignDec(CONS_UART_Write, StatErr); + Format_HHMMSS(CONS_UART_Write, Time); Format_String(CONS_UART_Write, "\n"); } - if(GPSchange) + if(GPSchange && GPS) { Format_String(CONS_UART_Write, "GPSchange: "); - Format_SignDec(CONS_UART_Write, PosErr); - Format_String(CONS_UART_Write, "\n"); } + GPS->PrintLine(Line); + Format_String(CONS_UART_Write, Line); } xSemaphoreGive(CONS_Mutex); #endif diff --git a/main/gps.cpp b/main/gps.cpp index adaa2a5..675f671 100644 --- a/main/gps.cpp +++ b/main/gps.cpp @@ -319,6 +319,7 @@ static void GPS_BurstStart(void) // wh GPS_Cmd[Len]=0; Format_String(GPS_UART_Write, GPS_Cmd, Len, 0); } #ifdef DEBUG_PRINT + uint8_t Len = strlen(GPS_Cmd); xSemaphoreTake(CONS_Mutex, portMAX_DELAY); Format_String(CONS_UART_Write, "GPS <- "); Format_String(CONS_UART_Write, GPS_Cmd, Len, 0); diff --git a/main/hal.cpp b/main/hal.cpp index 602d3c4..412b21b 100644 --- a/main/hal.cpp +++ b/main/hal.cpp @@ -634,10 +634,9 @@ static void esp_spp_cb(esp_spp_cb_event_t Event, esp_spp_cb_param_t *Param) case ESP_SPP_DATA_IND_EVT: // [30] data is sent by the client #ifdef DEBUG_PRINT xSemaphoreTake(CONS_Mutex, portMAX_DELAY); - Param->data_ind.handle, Param->data_ind.data, Param->data_ind.len Format_String(CONS_UART_Write, "BT_SPP: ["); Format_UnsDec(CONS_UART_Write, Param->data_ind.len); - ormat_String(CONS_UART_Write, "]\n"); + Format_String(CONS_UART_Write, "]\n"); xSemaphoreGive(CONS_Mutex); #endif break; diff --git a/main/rfm.h b/main/rfm.h index 7f7ea62..59f8a87 100644 --- a/main/rfm.h +++ b/main/rfm.h @@ -450,6 +450,42 @@ class RFM_TRX WriteByte( 0x00, REG_AFCCTRL); // [0x00] 0x20 = AfcLowBetaOn=1 -> page 64 -> page 33 WriteByte( +10, REG_TESTAFC); // [0x00] [488Hz] if AfcLowBetaOn return 0; } + + void PrintReg(void (*CONS_UART_Write)(char)) + { Format_String(CONS_UART_Write, "RFM69 Mode:"); + uint8_t RxMode=ReadMode(); + Format_Hex(CONS_UART_Write, RxMode); + CONS_UART_Write(' '); CONS_UART_Write('0'+DIO0_isOn()); + Format_String(CONS_UART_Write, " IRQ:"); + Format_Hex(CONS_UART_Write, ReadWord(REG_IRQFLAGS1)); + Format_String(CONS_UART_Write, " Pre:"); + Format_Hex(CONS_UART_Write, ReadWord(REG_PREAMBLEMSB)); + Format_String(CONS_UART_Write, " SYNC:"); + Format_Hex(CONS_UART_Write, ReadByte(REG_SYNCCONFIG)); + CONS_UART_Write('/'); + for(uint8_t Idx=0; Idx<8; Idx++) + Format_Hex(CONS_UART_Write, ReadByte(REG_SYNCVALUE1+Idx)); + Format_String(CONS_UART_Write, " FREQ:"); + Format_Hex(CONS_UART_Write, ReadByte(REG_FRFMSB)); + Format_Hex(CONS_UART_Write, ReadByte(REG_FRFMID)); + Format_Hex(CONS_UART_Write, ReadByte(REG_FRFLSB)); + Format_String(CONS_UART_Write, " RATE:"); + Format_Hex(CONS_UART_Write, ReadWord(REG_BITRATEMSB)); + Format_String(CONS_UART_Write, " FDEV:"); + Format_Hex(CONS_UART_Write, ReadWord(REG_FDEVMSB)); + Format_String(CONS_UART_Write, " DIO:"); + Format_Hex(CONS_UART_Write, ReadWord(REG_DIOMAPPING1)); + Format_String(CONS_UART_Write, " CFG:"); + Format_Hex(CONS_UART_Write, ReadByte(REG_PACKETCONFIG1)); + Format_Hex(CONS_UART_Write, ReadByte(REG_PACKETCONFIG2)); + Format_Hex(CONS_UART_Write, ReadByte(REG_FIFOTHRESH)); + Format_Hex(CONS_UART_Write, ReadByte(REG_PAYLOADLENGTH)); + Format_Hex(CONS_UART_Write, ReadByte(REG_RXBW)); + Format_Hex(CONS_UART_Write, ReadByte(REG_RSSICONFIG)); + Format_String(CONS_UART_Write, " PA:"); + Format_Hex(CONS_UART_Write, ReadByte(REG_PARAMP)); + Format_Hex(CONS_UART_Write, ReadByte(REG_PALEVEL)); + Format_String(CONS_UART_Write, "\n"); } #endif // #ifdef WITH_RFM95