mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 09:16:01 +03:00
Added tz_automatic_dst to MSP2_COMMON_TZ and MSP2_COMMON_SET_TZ (#6115)
* Added tz_automatic_dst to MSP2_COMMON_TZ and MSP2_COMMON_SET_TZ * Added logic to handle 2 vs 3 bytes in MSP2_COMMON_SET_TZ
This commit is contained in:
parent
ffb782bd92
commit
0ba91601ad
1 changed files with 5 additions and 1 deletions
|
@ -1404,6 +1404,7 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
|
|||
|
||||
case MSP2_COMMON_TZ:
|
||||
sbufWriteU16(dst, (uint16_t)timeConfig()->tz_offset);
|
||||
sbufWriteU8(dst, (uint8_t)timeConfig()->tz_automatic_dst);
|
||||
break;
|
||||
|
||||
case MSP2_INAV_AIR_SPEED:
|
||||
|
@ -2726,7 +2727,10 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
|||
case MSP2_COMMON_SET_TZ:
|
||||
if (dataSize == 2)
|
||||
timeConfigMutable()->tz_offset = (int16_t)sbufReadU16(src);
|
||||
else
|
||||
else if (dataSize == 3) {
|
||||
timeConfigMutable()->tz_offset = (int16_t)sbufReadU16(src);
|
||||
timeConfigMutable()->tz_automatic_dst = (uint8_t)sbufReadU8(src);
|
||||
} else
|
||||
return MSP_RESULT_ERROR;
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue