Skip to content

Commit 887d9be

Browse files
committed
Robot_Control: Update PROGMEM for compatibily with newer gcc
1 parent 01e0a49 commit 887d9be

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

libraries/Robot_Control/examples/explore/R06_Wheel_Calibration/scripts_library.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#include <avr/pgmspace.h>
22
#include <ArduinoRobot.h>
33

4-
prog_char script1[] PROGMEM="Wheel Calibration\n";
5-
prog_char script2[] PROGMEM="1. Put Robot on a flat surface\n";
6-
prog_char script3[] PROGMEM="2. Adjust speed with the knob on top\n";
7-
prog_char script4[] PROGMEM="3. If robot goes straight, it's done\n";
8-
prog_char script5[] PROGMEM="4. Use screwdriver on the trim on bottom\n";
9-
prog_char script6[] PROGMEM="Robot turns left, screw it clockwise;\n";
10-
prog_char script7[] PROGMEM="Turns right, screw it ct-colockwise;\n";
11-
prog_char script8[] PROGMEM="5. Repeat 4 until going straight\n";
4+
const char script1[] PROGMEM="Wheel Calibration\n";
5+
const char script2[] PROGMEM="1. Put Robot on a flat surface\n";
6+
const char script3[] PROGMEM="2. Adjust speed with the knob on top\n";
7+
const char script4[] PROGMEM="3. If robot goes straight, it's done\n";
8+
const char script5[] PROGMEM="4. Use screwdriver on the trim on bottom\n";
9+
const char script6[] PROGMEM="Robot turns left, screw it clockwise;\n";
10+
const char script7[] PROGMEM="Turns right, screw it ct-colockwise;\n";
11+
const char script8[] PROGMEM="5. Repeat 4 until going straight\n";
1212

1313
char buffer[42];//must be longer than text
1414

libraries/Robot_Control/src/Squawk.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ osc_t osc[4];
8181
uint8_t pcm = 128;
8282

8383
// ProTracker period tables
84-
uint16_t period_tbl[84] PROGMEM = {
84+
const uint16_t period_tbl[84] PROGMEM = {
8585
3424, 3232, 3048, 2880, 2712, 2560, 2416, 2280, 2152, 2032, 1920, 1814,
8686
1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016, 960, 907,
8787
856, 808, 762, 720, 678, 640, 604, 570, 538, 508, 480, 453,
@@ -92,7 +92,7 @@ uint16_t period_tbl[84] PROGMEM = {
9292
};
9393

9494
// ProTracker sine table
95-
int8_t sine_tbl[32] PROGMEM = {
95+
const int8_t sine_tbl[32] PROGMEM = {
9696
0x00, 0x0C, 0x18, 0x25, 0x30, 0x3C, 0x47, 0x51, 0x5A, 0x62, 0x6A, 0x70, 0x76, 0x7A, 0x7D, 0x7F,
9797
0x7F, 0x7F, 0x7D, 0x7A, 0x76, 0x70, 0x6A, 0x62, 0x5A, 0x51, 0x47, 0x3C, 0x30, 0x25, 0x18, 0x0C,
9898
};
@@ -598,4 +598,4 @@ void squawk_playroutine() {
598598
}
599599

600600
lockout = false;
601-
}
601+
}

libraries/Robot_Control/src/SquawkSD.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class StreamFile : public SquawkStream {
1313

1414
static StreamFile file;
1515

16-
extern uint16_t period_tbl[84] PROGMEM;
16+
extern const uint16_t period_tbl[84] PROGMEM;
1717

1818
void SquawkSynthSD::play(Fat16 melody) {
1919
SquawkSynth::pause();
@@ -179,4 +179,4 @@ void SquawkSynthSD::convert(Fat16 in, Fat16 out) {
179179
out.write(note[2] | (sample[2] == 0 ? 0x00 : 0x80));
180180
}
181181
}
182-
}*/
182+
}*/

libraries/Robot_Control/src/glcdfont.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
// standard ascii 5x7 font
88

9-
static unsigned char font[] PROGMEM = {
10-
0x00, 0x00, 0x00, 0x00, 0x00,
9+
static const unsigned char font[] PROGMEM = {
10+
0x00, 0x00, 0x00, 0x00, 0x00,
1111
0x3E, 0x5B, 0x4F, 0x5B, 0x3E,
1212
0x3E, 0x6B, 0x4F, 0x6B, 0x3E,
1313
0x1C, 0x3E, 0x7C, 0x3E, 0x1C,

libraries/Robot_Control/src/utility/scripts_Hello_User.h

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
//as the ram of Arduino is very tiny, keeping too many string in it
55
//can kill the program
66

7-
prog_char hello_user_script1[] PROGMEM="What's your name?";
8-
prog_char hello_user_script2[] PROGMEM="Give me a name!";
9-
prog_char hello_user_script3[] PROGMEM="And the country?";
10-
prog_char hello_user_script4[] PROGMEM="The city you're in?";
11-
prog_char hello_user_script5[] PROGMEM=" Plug me to\n\n your computer\n\n and start coding!";
7+
const char hello_user_script1[] PROGMEM="What's your name?";
8+
const char hello_user_script2[] PROGMEM="Give me a name!";
9+
const char hello_user_script3[] PROGMEM="And the country?";
10+
const char hello_user_script4[] PROGMEM="The city you're in?";
11+
const char hello_user_script5[] PROGMEM=" Plug me to\n\n your computer\n\n and start coding!";
1212

13-
prog_char hello_user_script6[] PROGMEM=" Hello User!\n\n It's me, your robot\n\n I'm alive! <3";
14-
prog_char hello_user_script7[] PROGMEM=" First I need some\n\n input from you!";
15-
prog_char hello_user_script8[] PROGMEM=" Use the knob\n\n to select letters";
16-
prog_char hello_user_script9[] PROGMEM=" Use L/R button\n\n to move the cursor,\n\n middle to confirm";
17-
prog_char hello_user_script10[] PROGMEM=" Press middle key\n to continue...";
18-
prog_char hello_user_script11[] PROGMEM=" Choose \"enter\" to\n\n finish the input";
13+
const char hello_user_script6[] PROGMEM=" Hello User!\n\n It's me, your robot\n\n I'm alive! <3";
14+
const char hello_user_script7[] PROGMEM=" First I need some\n\n input from you!";
15+
const char hello_user_script8[] PROGMEM=" Use the knob\n\n to select letters";
16+
const char hello_user_script9[] PROGMEM=" Use L/R button\n\n to move the cursor,\n\n middle to confirm";
17+
const char hello_user_script10[] PROGMEM=" Press middle key\n to continue...";
18+
const char hello_user_script11[] PROGMEM=" Choose \"enter\" to\n\n finish the input";
1919

20-
PROGMEM const char *scripts_Hello_User[]={
20+
const char * const scripts_Hello_User[] PROGMEM = {
2121
hello_user_script1,
2222
hello_user_script2,
2323
hello_user_script3,
@@ -48,4 +48,4 @@ void writeScript(int seq, int line, int col){
4848
textManager.writeText(line,col,buffer);
4949
}
5050
51-
*/
51+
*/

0 commit comments

Comments
 (0)