Skip to content

Commit 33b1e7c

Browse files
committed
GSM: Updated PROGMEM compatibility with newer gcc
1 parent b36beeb commit 33b1e7c

8 files changed

+15
-21
lines changed

libraries/GSM/src/GSM3ShieldV1AccessProvider.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#define __TOUTMODEMCONFIGURATION__ 5000//equivalent to 30000 because of time in interrupt routine.
77
#define __TOUTAT__ 1000
88

9-
char _command_AT[] PROGMEM = "AT";
10-
char _command_CGREG[] PROGMEM = "AT+CGREG?";
9+
const char _command_AT[] PROGMEM = "AT";
10+
const char _command_CGREG[] PROGMEM = "AT+CGREG?";
1111

1212

1313
GSM3ShieldV1AccessProvider::GSM3ShieldV1AccessProvider(bool debug)

libraries/GSM/src/GSM3ShieldV1BaseProvider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int GSM3ShieldV1BaseProvider::ready()
1212
return theGSM3ShieldV1ModemCore.getCommandError();
1313
};
1414

15-
void GSM3ShieldV1BaseProvider::prepareAuxLocate(PROGMEM prog_char str[], char auxLocate[])
15+
void GSM3ShieldV1BaseProvider::prepareAuxLocate(PGM_P str, char auxLocate[])
1616
{
1717
int i=0;
1818
char c;

libraries/GSM/src/GSM3ShieldV1BaseProvider.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class GSM3ShieldV1BaseProvider
5454
@param str PROGMEN
5555
@param auxLocate Buffer where to locate strings
5656
*/
57-
void prepareAuxLocate(PROGMEM prog_char str[], char auxLocate[]);
57+
void prepareAuxLocate(PGM_P str, char auxLocate[]);
5858

5959
/** Manages modem response
6060
@param from Initial byte of buffer
@@ -70,4 +70,4 @@ class GSM3ShieldV1BaseProvider
7070

7171
};
7272

73-
#endif
73+
#endif

libraries/GSM/src/GSM3ShieldV1DataNetworkProvider.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include <GSM3ShieldV1DataNetworkProvider.h>
22
#include <Arduino.h>
33

4-
char _command_CGATT[] PROGMEM = "AT+CGATT=";
5-
char _command_SEPARATOR[] PROGMEM = "\",\"";
4+
const char _command_CGATT[] PROGMEM = "AT+CGATT=";
5+
const char _command_SEPARATOR[] PROGMEM = "\",\"";
66

77
//Attach GPRS main function.
88
GSM3_NetworkStatus_t GSM3ShieldV1DataNetworkProvider::attachGPRS(char* apn, char* user_name, char* password, bool synchronous)

libraries/GSM/src/GSM3ShieldV1ModemCore.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void GSM3ShieldV1ModemCore::closeCommand(int code)
7575
}
7676

7777
//Generic command (stored in flash).
78-
void GSM3ShieldV1ModemCore::genericCommand_rq(PROGMEM prog_char str[], bool addCR)
78+
void GSM3ShieldV1ModemCore::genericCommand_rq(PGM_P str, bool addCR)
7979
{
8080
theBuffer().flush();
8181
writePGM(str, addCR);
@@ -157,7 +157,7 @@ void GSM3ShieldV1ModemCore::openCommand(GSM3ShieldV1BaseProvider* provider, GSM3
157157

158158
};
159159

160-
size_t GSM3ShieldV1ModemCore::writePGM(PROGMEM prog_char str[], bool CR)
160+
size_t GSM3ShieldV1ModemCore::writePGM(PGM_P str, bool CR)
161161
{
162162
int i=0;
163163
char c;

libraries/GSM/src/GSM3ShieldV1ModemCore.h

+4-10
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class GSM3ShieldV1ModemCore : public GSM3SoftSerialMgr, public Print
167167
@param CR Carriadge return adding automatically
168168
@return size
169169
*/
170-
virtual size_t writePGM(PROGMEM prog_char str[], bool CR=true);
170+
virtual size_t writePGM(PGM_P str, bool CR=true);
171171

172172
/** Establish debug mode
173173
@param db Boolean that indicates debug on or off
@@ -182,24 +182,18 @@ class GSM3ShieldV1ModemCore : public GSM3SoftSerialMgr, public Print
182182
*/
183183
bool genericParse_rsp(bool& rsp, char* string=0, char* string2=0);
184184

185-
/** Generates a generic AT command request from PROGMEM prog_char buffer
185+
/** Generates a generic AT command request from PROGMEM buffer
186186
@param str Buffer with AT command
187187
@param addCR Carriadge return adding automatically
188188
*/
189-
void genericCommand_rq(PROGMEM prog_char str[], bool addCR=true);
189+
void genericCommand_rq(PGM_P str, bool addCR=true);
190190

191191
/** Generates a generic AT command request from a simple char buffer
192192
@param str Buffer with AT command
193193
@param addCR Carriadge return adding automatically
194194
*/
195195
void genericCommand_rqc(const char* str, bool addCR=true);
196196

197-
/** Generates a generic AT command request from characters buffer
198-
@param str Buffer with AT command
199-
@param addCR Carriadge return adding automatically
200-
*/
201-
void genericCommand_rq(const char* str, bool addCR=true);
202-
203197
/** Returns the circular buffer
204198
@return circular buffer
205199
*/
@@ -257,4 +251,4 @@ class GSM3ShieldV1ModemCore : public GSM3SoftSerialMgr, public Print
257251

258252
extern GSM3ShieldV1ModemCore theGSM3ShieldV1ModemCore;
259253

260-
#endif
254+
#endif

libraries/GSM/src/GSM3ShieldV1MultiClientProvider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <GSM3ShieldV1MultiClientProvider.h>
22
#include <GSM3ShieldV1ModemCore.h>
33

4-
char _command_MultiQISRVC[] PROGMEM = "AT+QISRVC=";
4+
const char _command_MultiQISRVC[] PROGMEM = "AT+QISRVC=";
55

66
#define __TOUTFLUSH__ 10000
77

libraries/GSM/src/GSM3ShieldV1MultiServerProvider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#define __NCLIENTS_MAX__ 3
66

7-
char _command_QILOCIP[] PROGMEM = "AT+QILOCIP";
7+
const char _command_QILOCIP[] PROGMEM = "AT+QILOCIP";
88

99
GSM3ShieldV1MultiServerProvider::GSM3ShieldV1MultiServerProvider()
1010
{

0 commit comments

Comments
 (0)