Skip to content

Commit

Permalink
Clear the backpack OSD overlay when entering video modes.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkendall64 committed Feb 21, 2023
1 parent 335f56f commit e98600c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/elrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ bool elrs_headtracking_enabled() {
return headtracking_enabled;
}

static void clear_osd() {
void elrs_clear_osd() {
memset(elrs_osd_overlay, 0x20, sizeof(elrs_osd_overlay));
}

Expand All @@ -379,12 +379,12 @@ static void handleOSD(uint8_t payload[], uint8_t size) {
case 0x00: // hearbeat
break;
case 0x01: // release port
clear_osd();
elrs_clear_osd();
memcpy(elrs_osd, elrs_osd_overlay, sizeof(elrs_osd));
osd_signal_update();
break;
case 0x02: // clear screen
clear_osd();
elrs_clear_osd();
break;
case 0x03: // write string
{
Expand Down
1 change: 1 addition & 0 deletions src/core/elrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ typedef struct {

void elrs_init();
bool elrs_headtracking_enabled();
void elrs_clear_osd();

void msp_send_packet(uint16_t function, mspPacketType_e type, uint16_t payload_size, uint8_t *payload);
bool msp_read_resposne(uint16_t function, uint16_t *payload_size, uint8_t *payload);
Expand Down
1 change: 1 addition & 0 deletions src/core/osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ void osd_hdzero_update(void) {

int osd_clear(void) {
clear_screen();
elrs_clear_osd();
return 0;
}

Expand Down

0 comments on commit e98600c

Please sign in to comment.