Skip to content

Commit

Permalink
elrs: only allow rec mode change while in video mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner authored and bkleiner committed Feb 18, 2023
1 parent 4b898fe commit 04b6220
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/core/elrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,14 @@ void msp_process_packet() {
msp_send_packet(MSP_GET_REC_STATE, MSP_PACKET_RESPONSE, 1, &buf);
} break;
case MSP_SET_REC_STATE: {
record_state = packet.payload[0] == 0 ? 1 : 2;
uint32_t delay = packet.payload[1] | (uint32_t)packet.payload[2] << 8;
if (delay == 0)
osd_dvr_cmd(record_state);
else
record_time = time(NULL) + delay;
if (g_menu_op == OPLEVEL_VIDEO) {
record_state = packet.payload[0] == 0 ? 1 : 2;
uint32_t delay = packet.payload[1] | (uint32_t)packet.payload[2] << 8;
if (delay == 0)
osd_dvr_cmd(record_state);
else
record_time = time(NULL) + delay;
}
} break;
case MSP_GET_VRX_MODE:
break;
Expand Down

0 comments on commit 04b6220

Please sign in to comment.