Fix default compiler warnings

This commit is contained in:
Scott Smith 2016-07-30 15:41:25 -04:00
parent 343c95ae8c
commit 4cc73852f0
3 changed files with 77 additions and 77 deletions

View File

@ -74,7 +74,7 @@ Si5351 clockgen;
// set pins of red, green and blue
RGBTools rgb(12, 11, 10);
typedef enum {
typedef enum COLOR_T{
blue_color,
red_color,
purple_color,
@ -82,7 +82,7 @@ typedef enum {
turquoise_color,
yellow_color,
white_color,
};
} color_t;
// SD Card (Pin 50 = MISO, Pin 51 = MOSI, Pin 52 = SCK, Pin 53 = SS)
#include <SdFat.h>
@ -549,7 +549,7 @@ void print_Msg(const __FlashStringHelper *string) {
Serial.print(string);
}
void print_Msg(char string[]) {
void print_Msg(const char string[]) {
if (enable_OLED)
display.print(string);
if (enable_Serial)
@ -591,7 +591,7 @@ void println_Msg(byte message, int outputFormat) {
Serial.println(message, outputFormat);
}
void println_Msg(char message[]) {
void println_Msg(const char message[]) {
if (enable_OLED)
display.println(message);
if (enable_Serial)
@ -624,7 +624,7 @@ void display_Clear() {
}
}
unsigned char question_box(char* question, char answers[7][20], int num_answers, int default_choice) {
unsigned char question_box(const char* question, char answers[7][20], int num_answers, int default_choice) {
if (enable_OLED) {
return questionBox_OLED(question, answers, num_answers, default_choice);
}
@ -633,7 +633,7 @@ unsigned char question_box(char* question, char answers[7][20], int num_answers,
}
}
void fileBrowser(char browserTitle[]) {
void fileBrowser(const char browserTitle[]) {
if (enable_OLED) {
fileBrowser_OLED(browserTitle);
}
@ -652,7 +652,7 @@ void wait_serial() {
Serial.println("");
}
byte questionBox_Serial(char* question, char answers[7][20], int num_answers, int default_choice) {
byte questionBox_Serial(const char* question, char answers[7][20], int num_answers, int default_choice) {
// Print menu to serial monitor
Serial.print(question);
Serial.println(F(" Menu"));
@ -677,7 +677,7 @@ byte questionBox_Serial(char* question, char answers[7][20], int num_answers, in
}
// Prompt a filename from the Serial Monitor
void fileBrowser_Serial(char browserTitle[]) {
void fileBrowser_Serial(const char browserTitle[]) {
Serial.println(browserTitle);
// Print all files in root of SD
Serial.println(F("Name - Size"));
@ -832,7 +832,7 @@ void wait_btn() {
}
// Display a question box with selectable answers. Make sure default choice is in (0, num_answers]
unsigned char questionBox_OLED(char* question, char answers[7][20], int num_answers, int default_choice) {
unsigned char questionBox_OLED(const char* question, char answers[7][20], int num_answers, int default_choice) {
//clear the screen
display.clearDisplay();
@ -956,7 +956,7 @@ unsigned char questionBox_OLED(char* question, char answers[7][20], int num_answ
/******************************************
Filebrowser Module
*****************************************/
void fileBrowser_OLED(char browserTitle[]) {
void fileBrowser_OLED(const char browserTitle[]) {
char fileNames[30][26];
int currFile;
filebrowse = 1;

View File

@ -802,8 +802,8 @@ void readBlock(word myAddress) {
// Read Controller Pak command
unsigned char command[] = {0x02};
// Address Command
unsigned char addressHigh[] = {myAddressCRC >> 8};
unsigned char addressLow[] = {myAddressCRC & 0xff};
unsigned char addressHigh[] = {(unsigned char)(myAddressCRC >> 8)};
unsigned char addressLow[] = {(unsigned char)(myAddressCRC & 0xff)};
// don't want interrupts getting in the way
noInterrupts();
@ -902,8 +902,8 @@ void writeMPK() {
// Write Controller Pak command
unsigned char command[] = {0x03};
// Address Command
unsigned char addressHigh[] = {myAddressCRC >> 8};
unsigned char addressLow[] = {myAddressCRC & 0xff};
unsigned char addressHigh[] = {(unsigned char)(myAddressCRC >> 8)};
unsigned char addressLow[] = {(unsigned char)(myAddressCRC & 0xff)};
// don't want interrupts getting in the way
noInterrupts();

View File

@ -616,14 +616,14 @@ void resetFlash_NP(int startBank) {
// Reset command sequence
if (romType) {
writeBank_SNES(startBank, 0x5555 * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAA * 2, 0x55);
writeBank_SNES(startBank, 0x5555 * 2, 0xf0);
writeBank_SNES(startBank, 0x5555L * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAAL * 2, 0x55);
writeBank_SNES(startBank, 0x5555L * 2, 0xf0);
}
else {
writeBank_SNES(1, 0x8000 + 0x1555 * 2, 0xaa);
writeBank_SNES(0, 0x8000 + 0x2AAA * 2, 0x55);
writeBank_SNES(1, 0x8000 + 0x1555 * 2, 0xf0);
writeBank_SNES(1, 0x8000 + 0x1555L * 2, 0xaa);
writeBank_SNES(0, 0x8000 + 0x2AAAL * 2, 0x55);
writeBank_SNES(1, 0x8000 + 0x1555L * 2, 0xf0);
}
}
@ -636,9 +636,9 @@ void idFlash_NP(int startBank) {
if (romType) {
// ID command sequence
writeBank_SNES(startBank, 0x5555 * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAA * 2, 0x55);
writeBank_SNES(startBank, 0x5555 * 2, 0x90);
writeBank_SNES(startBank, 0x5555L * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAAL * 2, 0x55);
writeBank_SNES(startBank, 0x5555L * 2, 0x90);
// Set data pins to input again
dataIn();
@ -649,9 +649,9 @@ void idFlash_NP(int startBank) {
sprintf(flashid, "%x%x", readBank_SNES(startBank, 0x00), readBank_SNES(startBank, 0x02));
}
else {
writeBank_SNES(1, 0x8000 + 0x1555 * 2, 0xaa);
writeBank_SNES(0, 0x8000 + 0x2AAA * 2, 0x55);
writeBank_SNES(1, 0x8000 + 0x1555 * 2, 0x90);
writeBank_SNES(1, 0x8000 + 0x1555L * 2, 0xaa);
writeBank_SNES(0, 0x8000 + 0x2AAAL * 2, 0x55);
writeBank_SNES(1, 0x8000 + 0x1555L * 2, 0x90);
// Set data pins to input again
dataIn();
@ -690,9 +690,9 @@ void writeFlash_NP(int startBank, uint32_t pos) {
for (unsigned long currByte = 0; currByte < 0x10000; currByte += 128) {
myFile.read(sdBuffer, 128);
// Write command sequence
writeBank_SNES(startBank, 0x5555 * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAA * 2, 0x55);
writeBank_SNES(startBank, 0x5555 * 2, 0xa0);
writeBank_SNES(startBank, 0x5555L * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAAL * 2, 0x55);
writeBank_SNES(startBank, 0x5555L * 2, 0xa0);
for (byte c = 0; c < 128; c++) {
@ -715,9 +715,9 @@ void writeFlash_NP(int startBank, uint32_t pos) {
for (unsigned long currByte = 0x8000; currByte < 0x10000; currByte += 128) {
myFile.read(sdBuffer, 128);
// Write command sequence
writeBank_SNES(1, 0x8000 + 0x1555 * 2, 0xaa);
writeBank_SNES(0, 0x8000 + 0x2AAA * 2, 0x55);
writeBank_SNES(1, 0x8000 + 0x1555 * 2, 0xa0);
writeBank_SNES(1, 0x8000 + 0x1555L * 2, 0xaa);
writeBank_SNES(0, 0x8000 + 0x2AAAL * 2, 0x55);
writeBank_SNES(1, 0x8000 + 0x1555L * 2, 0xa0);
for (byte c = 0; c < 128; c++) {
// Write one byte of data
@ -786,20 +786,20 @@ void eraseFlash_NP(int startBank) {
if (romType) {
// Erase command sequence
writeBank_SNES(startBank, 0x5555 * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAA * 2, 0x55);
writeBank_SNES(startBank, 0x5555 * 2, 0x80);
writeBank_SNES(startBank, 0x5555 * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAA * 2, 0x55);
writeBank_SNES(startBank, 0x5555 * 2, 0x10);
writeBank_SNES(startBank, 0x5555L * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAAL * 2, 0x55);
writeBank_SNES(startBank, 0x5555L * 2, 0x80);
writeBank_SNES(startBank, 0x5555L * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAAL * 2, 0x55);
writeBank_SNES(startBank, 0x5555L * 2, 0x10);
}
else {
writeBank_SNES(1, 0x8000 + 0x1555 * 2, 0xaa);
writeBank_SNES(0, 0x8000 + 0x2AAA * 2, 0x55);
writeBank_SNES(1, 0x8000 + 0x1555 * 2, 0x80);
writeBank_SNES(1, 0x8000 + 0x1555 * 2, 0xaa);
writeBank_SNES(0, 0x8000 + 0x2AAA * 2, 0x55);
writeBank_SNES(1, 0x8000 + 0x1555 * 2, 0x10);
writeBank_SNES(1, 0x8000 + 0x1555L * 2, 0xaa);
writeBank_SNES(0, 0x8000 + 0x2AAAL * 2, 0x55);
writeBank_SNES(1, 0x8000 + 0x1555L * 2, 0x80);
writeBank_SNES(1, 0x8000 + 0x1555L * 2, 0xaa);
writeBank_SNES(0, 0x8000 + 0x2AAAL * 2, 0x55);
writeBank_SNES(1, 0x8000 + 0x1555L * 2, 0x10);
}
// Wait for erase to complete
@ -943,9 +943,9 @@ void readSectorProtection_NP(byte startBank) {
dataOut();
// Display Sector Protection Status
writeBank_SNES(startBank, 0x5555 * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAA * 2, 0x55);
writeBank_SNES(startBank, 0x5555 * 2, 0x90);
writeBank_SNES(startBank, 0x5555L * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAAL * 2, 0x55);
writeBank_SNES(startBank, 0x5555L * 2, 0x90);
// Configure control pins
controlIn_SNES();
@ -1002,14 +1002,14 @@ void printMapping() {
controlOut_SNES();
// Reset Flash
writeBank_SNES(0xC0, 0x5555 * 2, 0xaa);
writeBank_SNES(0xC0, 0x2AAA * 2, 0x55);
writeBank_SNES(0xC0, 0x5555 * 2, 0xf0);
writeBank_SNES(0xC0, 0x5555L * 2, 0xaa);
writeBank_SNES(0xC0, 0x2AAAL * 2, 0x55);
writeBank_SNES(0xC0, 0x5555L * 2, 0xf0);
// Reset Flash
writeBank_SNES(0xE0, 0x5555 * 2, 0xaa);
writeBank_SNES(0xE0, 0x2AAA * 2, 0x55);
writeBank_SNES(0xE0, 0x5555 * 2, 0xf0);
writeBank_SNES(0xE0, 0x5555L * 2, 0xaa);
writeBank_SNES(0xE0, 0x2AAAL * 2, 0x55);
writeBank_SNES(0xE0, 0x5555L * 2, 0xf0);
// Switch to read
dataIn();
@ -1089,14 +1089,14 @@ void readMapping() {
controlOut_SNES();
// Reset Flash
writeBank_SNES(0xC0, 0x5555 * 2, 0xaa);
writeBank_SNES(0xC0, 0x2AAA * 2, 0x55);
writeBank_SNES(0xC0, 0x5555 * 2, 0xf0);
writeBank_SNES(0xC0, 0x5555L * 2, 0xaa);
writeBank_SNES(0xC0, 0x2AAAL * 2, 0x55);
writeBank_SNES(0xC0, 0x5555L * 2, 0xf0);
// Reset Flash
writeBank_SNES(0xE0, 0x5555 * 2, 0xaa);
writeBank_SNES(0xE0, 0x2AAA * 2, 0x55);
writeBank_SNES(0xE0, 0x5555 * 2, 0xf0);
writeBank_SNES(0xE0, 0x5555L * 2, 0xaa);
writeBank_SNES(0xE0, 0x2AAAL * 2, 0x55);
writeBank_SNES(0xE0, 0x5555L * 2, 0xf0);
// Switch to read
dataIn();
@ -1121,13 +1121,13 @@ void eraseMapping(byte startBank) {
controlOut_SNES();
// Prepare to erase/write Page Buffer
writeBank_SNES(startBank, 0x5555 * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAA * 2, 0x55);
writeBank_SNES(startBank, 0x5555 * 2, 0x77);
writeBank_SNES(startBank, 0x5555L * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAAL * 2, 0x55);
writeBank_SNES(startBank, 0x5555L * 2, 0x77);
// Erase Page Buffer
writeBank_SNES(startBank, 0x5555 * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAA * 2, 0x55);
writeBank_SNES(startBank, 0x5555 * 2, 0xe0);
writeBank_SNES(startBank, 0x5555L * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAAL * 2, 0x55);
writeBank_SNES(startBank, 0x5555L * 2, 0xe0);
// Wait until complete
busyCheck_NP(startBank);
@ -1204,14 +1204,14 @@ byte blankcheckMapping() {
controlOut_SNES();
// Reset Flash
writeBank_SNES(0xC0, 0x5555 * 2, 0xaa);
writeBank_SNES(0xC0, 0x2AAA * 2, 0x55);
writeBank_SNES(0xC0, 0x5555 * 2, 0xf0);
writeBank_SNES(0xC0, 0x5555L * 2, 0xaa);
writeBank_SNES(0xC0, 0x2AAAL * 2, 0x55);
writeBank_SNES(0xC0, 0x5555L * 2, 0xf0);
// Reset Flash
writeBank_SNES(0xE0, 0x5555 * 2, 0xaa);
writeBank_SNES(0xE0, 0x2AAA * 2, 0x55);
writeBank_SNES(0xE0, 0x5555 * 2, 0xf0);
writeBank_SNES(0xE0, 0x5555L * 2, 0xaa);
writeBank_SNES(0xE0, 0x2AAAL * 2, 0x55);
writeBank_SNES(0xE0, 0x5555L * 2, 0xf0);
// Switch to read
dataIn();
@ -1242,13 +1242,13 @@ void writeMapping(byte startBank, uint32_t pos) {
// Write to Page Buffer
for (unsigned long currByte = 0xFF00; currByte < 0xFFFF; currByte += 128) {
// Prepare to erase/write Page Buffer
writeBank_SNES(startBank, 0x5555 * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAA * 2, 0x55);
writeBank_SNES(startBank, 0x5555 * 2, 0x77);
writeBank_SNES(startBank, 0x5555L * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAAL * 2, 0x55);
writeBank_SNES(startBank, 0x5555L * 2, 0x77);
// Write Page Buffer Command
writeBank_SNES(startBank, 0x5555 * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAA * 2, 0x55);
writeBank_SNES(startBank, 0x5555 * 2, 0x99);
writeBank_SNES(startBank, 0x5555L * 2, 0xaa);
writeBank_SNES(startBank, 0x2AAAL * 2, 0x55);
writeBank_SNES(startBank, 0x5555L * 2, 0x99);
myFile.read(sdBuffer, 128);