Merge pull request #10 from ggajoch/fix_debug_print

Fix compilation errors for #define DEBUG_PRINT
pull/12/head
Paweł Jałocha 2020-03-15 02:12:47 +00:00 zatwierdzone przez GitHub
commit f37bdc1f29
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 42 dodań i 6 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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);

Wyświetl plik

@ -640,10 +640,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;

Wyświetl plik

@ -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