AP_Notify: Display send_text made not static

This commit is contained in:
Randy Mackay 2017-01-20 14:50:07 +09:00 committed by Lucas De Marchi
parent 07c08c09a3
commit d12e0d6a82
3 changed files with 5 additions and 5 deletions

View File

@ -77,7 +77,6 @@ AP_Notify::AP_Notify()
// static flags, to allow for direct class update from device drivers
struct AP_Notify::notify_flags_and_values_type AP_Notify::flags;
struct AP_Notify::notify_events_type AP_Notify::events;
char AP_Notify::_send_text[NOTIFY_TEXT_BUFFER_SIZE] {};
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4
AP_BoardLED boardled;

View File

@ -122,16 +122,17 @@ public:
bool buzzer_enabled() const { return _buzzer_enable; }
static void send_text(const char *str);
static char* get_text() { return _send_text; }
// send text to display
void send_text(const char *str);
const char* get_text() const { return _send_text; }
private:
static NotifyDevice* _devices[];
static char _send_text[NOTIFY_TEXT_BUFFER_SIZE];
AP_Int8 _rgb_led_brightness;
AP_Int8 _rgb_led_override;
AP_Int8 _buzzer_enable;
AP_Int8 _display_type;
char _send_text[NOTIFY_TEXT_BUFFER_SIZE];
};

View File

@ -558,7 +558,7 @@ void Display::update_text(uint8_t r)
char msg [DISPLAY_MESSAGE_SIZE];
char txt [NOTIFY_TEXT_BUFFER_SIZE];
snprintf(txt, NOTIFY_TEXT_BUFFER_SIZE, "%s", AP_Notify::get_text());
snprintf(txt, NOTIFY_TEXT_BUFFER_SIZE, "%s", pNotify->get_text());
_mstartpos++;
for (uint8_t i = 0; i < sizeof(msg); i++) {
if (txt[i + _mstartpos - 1] != 0) {