Merge pull request #5 from reedbn/warning-cleanup

Warning cleanup
This commit is contained in:
reedbn 2020-01-26 10:55:34 -08:00 committed by GitHub
commit bbe34daff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 21 additions and 24 deletions

View File

@ -839,7 +839,7 @@ void PDQ_GFX<HW>::drawChar(coord_t x, coord_t y, unsigned char c, color_t color,
// Draw a character with GFX font // Draw a character with GFX font
template<class HW> template<class HW>
void PDQ_GFX<HW>::drawCharGFX(coord_t x, coord_t y, unsigned char c, color_t color, color_t bg, uint8_t size) void PDQ_GFX<HW>::drawCharGFX(coord_t x, coord_t y, unsigned char c, color_t color, color_t /*bg*/, uint8_t size)
{ {
// Character is assumed previously filtered by write() to eliminate // Character is assumed previously filtered by write() to eliminate
// newlines, returns, non-printable characters, etc. Calling drawChar() // newlines, returns, non-printable characters, etc. Calling drawChar()

View File

@ -83,7 +83,7 @@ void enc_setup(void)
TCCR1A = 0;//"normal" mode TCCR1A = 0;//"normal" mode
TCCR1B = 3;//clock divider of 64 TCCR1B = 3;//clock divider of 64
TCNT1 = 0;//start counting at 0 TCNT1 = 0;//start counting at 0
OCR1A = F_CPU * CALLBACK_PERIOD_MS / 1000 / 64;//set target number OCR1A = F_CPU * (unsigned long)CALLBACK_PERIOD_MS / 1000 / 64;//set target number
TIMSK1 |= (1 << OCIE1A);//enable interrupt TIMSK1 |= (1 << OCIE1A);//enable interrupt
} }

View File

@ -29,7 +29,7 @@
*/ */
//CW ADC Range //CW ADC Range
static const unsigned int cwAdcSTFrom = 0; //static const unsigned int cwAdcSTFrom = 0;
static const unsigned int cwAdcSTTo = 50; static const unsigned int cwAdcSTTo = 50;
static const unsigned int cwAdcBothFrom = cwAdcSTTo + 1; static const unsigned int cwAdcBothFrom = cwAdcSTTo + 1;
static const unsigned int cwAdcBothTo = 300; static const unsigned int cwAdcBothTo = 300;
@ -79,7 +79,7 @@ uint8_t keyerControl = 0;
char update_PaddleLatch(bool isUpdateKeyState) { char update_PaddleLatch(bool isUpdateKeyState) {
unsigned char tmpKeyerControl = 0; unsigned char tmpKeyerControl = 0;
int paddle = analogRead(ANALOG_KEYER); unsigned int paddle = analogRead(ANALOG_KEYER);
//use the PTT as the key for tune up, quick QSOs //use the PTT as the key for tune up, quick QSOs
if (digitalRead(PTT) == 0) if (digitalRead(PTT) == 0)
@ -93,7 +93,7 @@ char update_PaddleLatch(bool isUpdateKeyState) {
else{ else{
if (KeyerMode_e::KEYER_STRAIGHT != globalSettings.keyerMode) if (KeyerMode_e::KEYER_STRAIGHT != globalSettings.keyerMode)
tmpKeyerControl = 0 ; tmpKeyerControl = 0 ;
else if (paddle >= cwAdcSTFrom && paddle <= cwAdcSTTo) else if (paddle <= cwAdcSTTo)
tmpKeyerControl = DIT_L ; tmpKeyerControl = DIT_L ;
else else
tmpKeyerControl = 0 ; tmpKeyerControl = 0 ;

View File

@ -66,7 +66,7 @@ static void morseLetter(char c, uint16_t dit_duration_ms){
return; return;
} }
for (int i = 0; i < sizeof(morse_table)/ sizeof(struct Morse); i++){ for (unsigned int i = 0; i < sizeof(morse_table)/ sizeof(struct Morse); i++){
struct Morse m; struct Morse m;
memcpy_P(&m, morse_table + i, sizeof(struct Morse)); memcpy_P(&m, morse_table + i, sizeof(struct Morse));

View File

@ -162,7 +162,7 @@ PDQ_ILI9341 tft;
#include "nano_font.h" #include "nano_font.h"
bool xpt2046_Init(){ void xpt2046_Init(){
pinMode(CS_PIN, OUTPUT); pinMode(CS_PIN, OUTPUT);
digitalWrite(CS_PIN, HIGH); digitalWrite(CS_PIN, HIGH);
} }
@ -246,7 +246,8 @@ void setupTouch(){
int x1, y1, x2, y2, x3, y3, x4, y4; int x1, y1, x2, y2, x3, y3, x4, y4;
displayClear(DISPLAY_BLACK); displayClear(DISPLAY_BLACK);
displayText("Click on the cross", 20,100, 200, 50, DISPLAY_WHITE, DISPLAY_BLACK, DISPLAY_BLACK); strncpy_P(b,(const char*)F("Click on the cross"),sizeof(b));
displayText(b, 20,100, 200, 50, DISPLAY_WHITE, DISPLAY_BLACK, DISPLAY_BLACK);
// TOP-LEFT // TOP-LEFT
displayHline(10,20,20,DISPLAY_WHITE); displayHline(10,20,20,DISPLAY_WHITE);

View File

@ -87,7 +87,7 @@ struct SettingScreen_t {
void runSetting(const SettingScreen_t* const p_screen) void runSetting(const SettingScreen_t* const p_screen)
{ {
SettingScreen_t screen = {0}; SettingScreen_t screen = {nullptr,nullptr,0,0,nullptr,nullptr,nullptr,nullptr};
memcpy_P(&screen,p_screen,sizeof(screen)); memcpy_P(&screen,p_screen,sizeof(screen));
displayDialog(screen.Title, displayDialog(screen.Title,
screen.AdditionalText); screen.AdditionalText);
@ -235,7 +235,7 @@ void ssCwSpeedValidate(const long int candidate_value_in, long int* validated_va
{ {
*validated_value_out = LIMIT(candidate_value_in,1,100); *validated_value_out = LIMIT(candidate_value_in,1,100);
} }
void ssCwSpeedChange(const long int new_value, char* buff_out, const size_t buff_out_size) void ssCwSpeedChange(const long int new_value, char* buff_out, const size_t /*buff_out_size*/)
{ {
ltoa(new_value, buff_out, 10); ltoa(new_value, buff_out, 10);
} }
@ -334,7 +334,7 @@ void ssKeyerInitialize(long int* start_value_out)
} }
void ssKeyerValidate(const long int candidate_value_in, long int* validated_value_out) void ssKeyerValidate(const long int candidate_value_in, long int* validated_value_out)
{ {
*validated_value_out = LIMIT(candidate_value_in,KeyerMode_e::KEYER_STRAIGHT,KeyerMode_e::KEYER_IAMBIC_B); *validated_value_out = LIMIT(candidate_value_in,(uint8_t)KeyerMode_e::KEYER_STRAIGHT,(uint8_t)KeyerMode_e::KEYER_IAMBIC_B);
} }
void ssKeyerChange(const long int new_value, char* buff_out, const size_t buff_out_size) void ssKeyerChange(const long int new_value, char* buff_out, const size_t buff_out_size)
{ {
@ -350,7 +350,7 @@ void ssKeyerChange(const long int new_value, char* buff_out, const size_t buff_o
} }
void ssKeyerFinalize(const long int final_value) void ssKeyerFinalize(const long int final_value)
{ {
globalSettings.keyerMode = final_value; globalSettings.keyerMode = (KeyerMode_e)final_value;
SaveSettingsToEeprom(); SaveSettingsToEeprom();
} }
const char SS_KEYER_T [] PROGMEM = "CW Keyer/Paddle Type"; const char SS_KEYER_T [] PROGMEM = "CW Keyer/Paddle Type";
@ -409,7 +409,7 @@ void runResetAllSetting(){runSetting(&ssResetAll);}
struct MenuItem_t { struct MenuItem_t {
const char* const ItemName; const char* const ItemName;
const void (*OnSelect)(); void (*OnSelect)();
}; };
void runMenu(const MenuItem_t* const menu_items, const uint16_t num_items); void runMenu(const MenuItem_t* const menu_items, const uint16_t num_items);
@ -480,7 +480,7 @@ void movePuck(unsigned int old_index, unsigned int new_index)
void runMenu(const MenuItem_t* const menu_items, const uint16_t num_items) void runMenu(const MenuItem_t* const menu_items, const uint16_t num_items)
{ {
static const unsigned int COUNTS_PER_ITEM = 10; static const unsigned int COUNTS_PER_ITEM = 10;
const unsigned int MAX_KNOB_VALUE = num_items*COUNTS_PER_ITEM - 1; const int MAX_KNOB_VALUE = num_items*COUNTS_PER_ITEM - 1;
int knob_sum = 0; int knob_sum = 0;
unsigned int old_index = 0; unsigned int old_index = 0;

View File

@ -19,7 +19,6 @@ static byte rxBufferCheckCount = 0;
#define CAT_RECEIVE_TIMEOUT 500 #define CAT_RECEIVE_TIMEOUT 500
static byte cat[5]; static byte cat[5];
static byte insideCat = 0; static byte insideCat = 0;
static byte useOpenRadioControl = 0;
//for broken protocol //for broken protocol
#define CAT_RECEIVE_TIMEOUT 500 #define CAT_RECEIVE_TIMEOUT 500

View File

@ -66,12 +66,11 @@ void i2cWriten(uint8_t reg, uint8_t *vals, uint8_t vcnt) { // write array
void si5351bx_init() { // Call once at power-up, start PLLA void si5351bx_init() { // Call once at power-up, start PLLA
uint8_t reg; uint32_t msxp1;
Wire.begin(); Wire.begin();
i2cWrite(149, 0); // SpreadSpectrum off i2cWrite(149, 0); // SpreadSpectrum off
i2cWrite(3, si5351bx_clken); // Disable all CLK output drivers i2cWrite(3, si5351bx_clken); // Disable all CLK output drivers
i2cWrite(183, SI5351BX_XTALPF << 6); // Set 25mhz crystal load capacitance i2cWrite(183, SI5351BX_XTALPF << 6); // Set 25mhz crystal load capacitance
msxp1 = 128 * SI5351BX_MSA - 512; // and msxp2=0, msxp3=1, not fractional uint32_t msxp1 = 128 * SI5351BX_MSA - 512; // and msxp2=0, msxp3=1, not fractional
uint8_t vals[8] = {0, 1, BB2(msxp1), BB1(msxp1), BB0(msxp1), 0, 0, 0}; uint8_t vals[8] = {0, 1, BB2(msxp1), BB1(msxp1), BB0(msxp1), 0, 0, 0};
i2cWriten(26, vals, 8); // Write to 8 PLLA msynth regs i2cWriten(26, vals, 8); // Write to 8 PLLA msynth regs
i2cWrite(177, 0x20); // Reset PLLA (0x80 resets PLLB) i2cWrite(177, 0x20); // Reset PLLA (0x80 resets PLLB)

View File

@ -193,8 +193,9 @@ int getValueByKnob(int minimum, int maximum, int step_size, int initial, const
} }
void displayVFO(Vfo_e vfo){ void displayVFO(Vfo_e vfo){
int x, y; uint16_t displayColor = COLOR_INACTIVE_TEXT;
int displayColor, displayBackground, displayBorder; uint16_t displayBackground = COLOR_INACTIVE_BACKGROUND;
uint16_t displayBorder = COLOR_INACTIVE_BORDER;
Button button; Button button;
if (globalSettings.splitOn){ if (globalSettings.splitOn){

View File

@ -305,8 +305,6 @@ void checkPTT(){
//check if the encoder button was pressed //check if the encoder button was pressed
void checkButton(){ void checkButton(){
int i, t1, t2, knob, new_knob;
//only if the button is pressed //only if the button is pressed
if (!btnDown()) if (!btnDown())
return; return;
@ -325,9 +323,8 @@ void checkButton(){
doSetup2(); doSetup2();
return; return;
} }
} }
active_delay(100); active_delay(100);
doCommands(); doCommands();
//wait for the button to go up again //wait for the button to go up again