Fix sensor number and identations

This commit is contained in:
Adrian Scillato 2019-12-17 01:40:56 -03:00 committed by GitHub
parent 1a02f52de9
commit ed92cdc74c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@
Version Date Action Description
--------------------------------------------------------------------------------------------
0.9.1.0 20191216 integrate - Added pin specifications from Tasmota WEB UI
0.9.1.0 20191216 integrate - Added pin specifications from Tasmota WEB UI. Minor tweaks.
---
0.9.0.0 20190817 started - further development by Christian Baars - https://github.com/Staars/Sonoff-Tasmota
forked - from arendst/tasmota - https://github.com/arendst/Sonoff-Tasmota
@ -299,17 +299,6 @@ void UBXinitCFG(void){
UBXSerial->write( pgm_read_byte(UBLOX_INIT+i) );
}
DEBUG_SENSOR_LOG(PSTR("UBX: turn off NMEA"));
/*
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_KNX D_ADD " GA #%d: %s " D_TO " %d/%d/%d"),
Settings.knx_GA_registered,
device_param_ga[GAop-1],
GA_FNUM, GA_AREA, GA_FDEF );
*/
}
void UBXTriggerTele(void){
@ -438,8 +427,7 @@ uint32_t UBXprocessGPS() {
if(data_bytes!=0) {
UBX.state.non_empty_loops++;
DEBUG_SENSOR_LOG(PSTR("UBX: got %u bytes, non-empty-loop: %u"), data_bytes, UBX.state.non_empty_loops);
}
else{
} else {
UBX.state.non_empty_loops = 0; // now a hidden GPS-device reset is unlikely
}
return MT_NONE;
@ -541,6 +529,7 @@ void UBXSelectMode(uint16_t mode){
}
AddLog_P(LOG_LEVEL_INFO, PSTR("UBX: stop recording"));
break;
#endif //USE_FLOG
case 7:
UBX.mode.send_when_new = 1; // send mqtt on new postion + TELE -> consider to set TELE to a very high value
break;
@ -565,9 +554,6 @@ void UBXSelectMode(uint16_t mode){
Settings.latitude = UBX.state.last_lat;
Settings.longitude = UBX.state.last_lon;
break;
#endif //USE_FLOG
default:
if(mode>1000 && mode <1066) {
// UBXSetRate(mode-1000); // min. 1001 = 0.001 Hz, but will be converted to 1/65535 anyway ~0.015 Hz, max. 2000 = 1.000 Hz
@ -601,8 +587,7 @@ bool UBXHandlePOSLLH(){
UBXTriggerTele();
}
return true; // new position
}
else {
} else {
DEBUG_SENSOR_LOG(PSTR("UBX: no valid position data"));
}
return false; // no GPS-fix
@ -617,6 +602,7 @@ void UBXHandleSTATUS(){
UBX.state.gpsFix = 0; // without valid flag, everything is "no fix"
}
}
void UBXHandleTIME(){
DEBUG_SENSOR_LOG(PSTR("UBX: UTC-Time: %u-%u-%u %u:%u:%u"),UBX.Message.navTime.year, UBX.Message.navTime.month ,UBX.Message.navTime.day,UBX.Message.navTime.hour,UBX.Message.navTime.min,UBX.Message.navTime.sec);
if(UBX.Message.navTime.valid.UTC){
@ -636,7 +622,8 @@ void UBXHandleTIME(){
}
}
void UBXHandleOther(void){
void UBXHandleOther(void)
{
if(UBX.state.non_empty_loops>6){ // we expect only 4-5 non-empty loops in a row, could change with other sensor speed (Hz)
UBXinitCFG(); // this should only happen with lots of NMEA-messages, but it is only a guess!!
AddLog_P(LOG_LEVEL_ERROR, PSTR("UBX: possible device-reset, will re-init"));
@ -647,7 +634,8 @@ void UBXHandleOther(void){
/********************************************************************************************/
void UBXTimeServer(){
void UBXTimeServer()
{
if(UBX.mode.runningNTP){
timeServer.processOneRequest(Rtc.utc_time, UBX.state.last_iTOW%1000);
}
@ -752,8 +740,7 @@ void UBXShow(bool json)
if(UBX.mode.send_UI_only){
uint32_t i = UBX.state.log_interval / 10;
ResponseAppend_P(PSTR("\"fil\":%u,\"int\":%u}"),UBX.mode.filter_noise, i);
}
else{
} else {
ResponseAppend_P(PSTR("\"lat\":%s,\"lon\":%s,\"height\":%s,\"hAcc\":%s,\"vAcc\":%s}"), lat, lon, height, hAcc, vAcc);
}
#ifdef USE_FLOG
@ -817,7 +804,7 @@ bool Xsns58(uint8_t function)
UBXDetect();
break;
case FUNC_COMMAND_SENSOR:
if (XSNS_92 == XdrvMailbox.index){
if (XSNS_58 == XdrvMailbox.index){
result = UBXCmd();
}
break;