From 51bb2a3b8d5c535368c7f557c0e0ffc4a88dca44 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 10 Jan 2013 21:27:41 +1100 Subject: [PATCH] AP_GPS: put SIRF init_messages in progmem this saves 32 bytes of memory --- libraries/AP_GPS/AP_GPS_SIRF.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_GPS/AP_GPS_SIRF.cpp b/libraries/AP_GPS/AP_GPS_SIRF.cpp index d11aab44b8..159ea174c4 100644 --- a/libraries/AP_GPS/AP_GPS_SIRF.cpp +++ b/libraries/AP_GPS/AP_GPS_SIRF.cpp @@ -18,7 +18,7 @@ // // XXX the bytes show up on the wire, but at least my test unit (EM-411) seems to ignore them. // -static uint8_t init_messages[] = { +static const uint8_t init_messages[] PROGMEM = { 0xa0, 0xa2, 0x00, 0x08, 0xa6, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xb0, 0xb3, 0xa0, 0xa2, 0x00, 0x08, 0xa6, 0x00, 0x29, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xb0, 0xb3 }; @@ -39,7 +39,7 @@ AP_GPS_SIRF::init(enum GPS_Engine_Setting nav_setting) // before calling us. // send SiRF binary setup messages - _port->write(init_messages, sizeof(init_messages)); + _write_progstr_block(_port, (const prog_char *)init_messages, sizeof(init_messages)); idleTimeout = 1200; }