Resolved various compiler warnings

This should make Jenkins happy.
This commit is contained in:
Patrick Fallberg
2015-08-09 10:06:09 +02:00
parent 7f9fd843de
commit af6e5d3019
41 changed files with 123 additions and 87 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ Bounce::Bounce() {
void Bounce::attach(int pin) {
this->pin = pin;
debouncedState = unstableState = digitalRead(pin);
#ifdef BOUNCE_LOCK-OUT
#ifdef BOUNCE_LOCK_OUT
previous_millis = 0;
#else
previous_millis = millis();
@@ -37,7 +37,7 @@ void Bounce::interval(unsigned long interval_millis)
bool Bounce::update()
{
#ifdef BOUNCE_LOCK-OUT
#ifdef BOUNCE_LOCK_OUT
stateChanged = false;
// Ignore everything if we are locked out
if (millis() - previous_millis >= interval_millis) {
+1 -1
View File
@@ -24,7 +24,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * */
// Uncomment the following line for "LOCK-OUT" debounce method
//#define BOUNCE_LOCK-OUT
//#define BOUNCE_LOCK_OUT
#ifndef Bounce2_h
+3 -3
View File
@@ -142,9 +142,9 @@ void DHT::readSensor()
// - Then 40 bits: RISING and then a FALLING edge per bit
// To keep our code simple, we accept any HIGH or LOW reading if it's max 85 usecs long
word rawHumidity;
word rawTemperature;
word data;
word rawHumidity = 0;
word rawTemperature = 0;
word data = 0;
for ( int8_t i = -3 ; i < 2 * 40; i++ ) {
byte age;
@@ -700,6 +700,7 @@ void DallasTemperature::setAlarmHandler(AlarmHandler *handler)
// The default alarm handler
void DallasTemperature::defaultAlarmHandler(const uint8_t* deviceAddress)
{
(void)deviceAddress;
}
#endif
-1
View File
@@ -50,7 +50,6 @@
*/
bool I2cMasterBase::transfer(uint8_t addrRW,
void *buf, size_t nbytes, uint8_t option) {
uint8_t* p = reinterpret_cast<uint8_t*>(buf);
if (_state != STATE_REP_START) {
start();
}
+2 -2
View File
@@ -132,7 +132,7 @@ class SoftI2cMaster : public I2cMasterBase {
//----------------------------------------------------------------------------
void sclDelay(uint8_t n) {_delay_loop_1(n);}
//----------------------------------------------------------------------------
bool writeScl(bool value) {
void writeScl(bool value) {
uint8_t s = SREG;
noInterrupts();
if (value == LOW) {
@@ -145,7 +145,7 @@ class SoftI2cMaster : public I2cMasterBase {
SREG = s;
}
//----------------------------------------------------------------------------
bool writeSda(bool value) {
void writeSda(bool value) {
uint8_t s = SREG;
noInterrupts();
if (value == LOW) {
+9 -3
View File
@@ -649,7 +649,7 @@ bool IRdecodeRC6::decode(void) {
* Hopefully this code is unique for each button.
*/
#define FNV_PRIME_32 16777619
#define FNV_BASIS_32 2166136261
#define FNV_BASIS_32 2166136261UL
// Compare two tick values, returning 0 if newval is shorter,
// 1 if newval is equal, and 2 if newval is longer
int IRdecodeHash::compare(unsigned int oldval, unsigned int newval) {
@@ -730,12 +730,12 @@ void IRrecvBase::resume() {
bool IRrecvLoop::GetResults(IRdecodeBase *decoder) {
bool Finished=false;
byte OldState=HIGH;byte NewState;
unsigned long StartTime, DeltaTime, EndTime;
unsigned long StartTime, DeltaTime=0, EndTime=0;
StartTime=micros();
while(irparams.rawlen<RAWBUF) { //While the buffer not overflowing
while(OldState==(NewState=digitalRead(irparams.recvpin))) { //While the pin hasn't changed
if( (DeltaTime = (EndTime=micros()) - StartTime) > 10000) { //If it's a very long wait
if(Finished=irparams.rawlen) break; //finished unless it's the opening gap
if((Finished=irparams.rawlen)) break; //finished unless it's the opening gap
}
}
if(Finished) break;
@@ -798,6 +798,9 @@ void IRrecvPCI_Handler(){
case STATE_IDLE:
if(digitalRead(irparams.recvpin)) return; else irparams.rcvstate=STATE_RUNNING;
break;
default:
// what of STATE_UNKNOWN, STATE_MARK and STATE_SPACE?
break;
};
irparams.rawbuf[irparams.rawlen]=DeltaTime;
irparams.timer=ChangeTime;
@@ -982,6 +985,9 @@ ISR(TIMER_INTR_NAME)
irparams.timer = 0;
}
break;
default:
// what of STATE_UNKNOWN and STATE_RUNNING?
break;
}
do_Blink();
}
+1 -1
View File
@@ -48,7 +48,7 @@
#define RAWBUF 100 // Length of raw duration buffer (cannot exceed 255)
typedef char IRTYPES; //formerly was an enum
typedef unsigned char IRTYPES; //formerly was an enum
#define UNKNOWN 0
#define NEC 1
#define SONY 2
+8 -6
View File
@@ -90,6 +90,8 @@ inline static void waitUsec ( uint16_t uSec )
{
#ifndef FAST_MODE
delayMicroseconds ( uSec );
#else
(void)uSec;
#endif // FAST_MODE
}
@@ -481,7 +483,7 @@ public:
@param value: pin associated to backlight control.
@param pol: backlight polarity control (POSITIVE, NEGATIVE)
*/
virtual void setBacklightPin ( uint8_t value, t_backlighPol pol ) { };
virtual void setBacklightPin ( uint8_t /*value*/, t_backlighPol /*pol*/ ) { };
/*!
@function
@@ -500,7 +502,7 @@ public:
BACKLIGHT_OFF will be interpreted as off and BACKLIGHT_ON will drive the
backlight on.
*/
virtual void setBacklight ( uint8_t value ) { };
virtual void setBacklight ( uint8_t /*value*/ ) { };
/*!
@function
@@ -514,9 +516,9 @@ public:
@param value[in] Value to write to the LCD.
*/
#if (ARDUINO < 100)
virtual void write(uint8_t value);
virtual void write(uint8_t /*value*/);
#else
virtual size_t write(uint8_t value);
virtual size_t write(uint8_t /*value*/);
#endif
#if (ARDUINO < 100)
@@ -566,9 +568,9 @@ private:
the LCD.
*/
#if (ARDUINO < 100)
virtual void send(uint8_t value, uint8_t mode) { };
virtual void send(uint8_t /*value*/, uint8_t /*mode*/) { };
#else
virtual void send(uint8_t value, uint8_t mode) = 0;
virtual void send(uint8_t /*value*/, uint8_t /*mode*/) = 0;
#endif
};
@@ -38,7 +38,7 @@
LiquidCrystal_I2C_ByVac::LiquidCrystal_I2C_ByVac( uint8_t lcd_Addr )
{
_Addr = lcd_Addr;
_polarity == NEGATIVE;
_polarity = NEGATIVE;
}
// PUBLIC METHODS
+4 -2
View File
@@ -110,6 +110,8 @@ LiquidCrystal_SR::LiquidCrystal_SR (uint8_t srdata, uint8_t srclock,
void LiquidCrystal_SR::init(uint8_t srdata, uint8_t srclock, uint8_t enable,
uint8_t lines, uint8_t font)
{
(void)lines;
(void)font;
// Initialise private variables
_two_wire = 0;
@@ -200,10 +202,10 @@ void LiquidCrystal_SR::send(uint8_t value, uint8_t mode)
//
// setBacklightPin
void LiquidCrystal_SR::setBacklightPin ( uint8_t pin, t_backlighPol pol )
{ }
{ (void)pin; (void)pol; }
//
// setBacklight
void LiquidCrystal_SR::setBacklight ( uint8_t mode )
{ }
{ (void)mode; }
@@ -49,6 +49,8 @@ LiquidCrystal_SR1W::LiquidCrystal_SR1W (uint8_t srdata, t_sr1w_circuitType circu
// init
void LiquidCrystal_SR1W::init(uint8_t srdata, t_sr1w_circuitType circuitType, t_backlighPol blpol, uint8_t lines, uint8_t font)
{
(void)lines;
(void)font;
_srRegister = fio_pinToOutputRegister(srdata);
_srMask = fio_pinToBit(srdata);
+1 -1
View File
@@ -154,7 +154,7 @@
// | | | / | 1k
// | +--8-|GND Q'H|--9-----+ |
// | | +---------+ | | (GND)--(LCD RW)
// | | 0.1uF | \
/* | | 0.1uF | \ */
// | (GND)-----||----(VCC) +------)--------------(LCD EN)
// | | /
// |----|<|----+--[ Resistor ]--| |
@@ -47,6 +47,8 @@ LiquidCrystal_SR2W::LiquidCrystal_SR2W (uint8_t srdata, uint8_t srclock, t_backl
// init
void LiquidCrystal_SR2W::init(uint8_t srdata, uint8_t srclock, t_backlighPol blpol, uint8_t lines, uint8_t font)
{
(void)lines;
(void)font;
_srDataRegister = fio_pinToOutputRegister(srdata);
_srDataMask = fio_pinToBit(srdata);
_srClockRegister = fio_pinToOutputRegister(srclock);
+1 -2
View File
@@ -53,7 +53,7 @@
// but now can be used in any sensor node. Also the LEDs can now be
// disabled in the gateway.
//#define WITH_LEDS_BLINKING
// #define WITH_LEDS_BLINKING
// The following setting allows you to inverse the blinking feature WITH_LEDS_BLINKING
// When WITH_LEDS_BLINKING_INVERSE is enabled LEDSs are normally turned on and switches
@@ -103,7 +103,6 @@
// Key to use for HMAC calculation in MySigningAtsha204Soft (32 bytes)
#define MY_HMAC_KEY 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
/**********************************
* NRF24L01 Driver Defaults
***********************************/
+1
View File
@@ -550,6 +550,7 @@ boolean MySensor::process() {
#endif
uint8_t len = radio.receive((uint8_t *)&msg);
(void)len; //until somebody makes use of 'len'
#ifdef WITH_LEDS_BLINKING
rxBlink(1);
#endif
+5 -5
View File
@@ -343,11 +343,6 @@ class MySensor
MyMessage msg; // Buffer for incoming messages.
MyMessage tmpMsg ; // Buffer for temporary messages (acks and nonces among others).
#ifdef MY_SIGNING_FEATURE
uint16_t doSign[16]; // Bitfield indicating which sensors require signed communication
MyMessage msgSign; // Buffer for message to sign.
MySigning& signer;
#endif
#ifdef WITH_LEDS_BLINKING
uint8_t pinRx; // Rx led pin
@@ -364,6 +359,11 @@ class MySensor
#endif
MyTransport& radio;
#ifdef MY_SIGNING_FEATURE
uint16_t doSign[16]; // Bitfield indicating which sensors require signed communication
MyMessage msgSign; // Buffer for message to sign.
MySigning& signer;
#endif
MyHw& hw;
boolean sendWrite(uint8_t dest, MyMessage &message);
@@ -28,6 +28,8 @@
#include "MySigning.h"
#include "MySigningAtsha204.h"
#define SIGNING_IDENTIFIER (1)
// Uncomment this to get some useful serial debug info (Serial.print and Serial.println expected)
//#define DEBUG_SIGNING
-2
View File
@@ -33,8 +33,6 @@
#include "utility/ATSHA204.h"
#include <stdint.h>
#define SIGNING_IDENTIFIER (1)
#ifdef MY_SECURE_NODE_WHITELISTING
typedef struct {
uint8_t nodeId;
@@ -33,6 +33,8 @@
#include "MySigningAtsha204Soft.h"
#include "utility/sha256.h"
#define SIGNING_IDENTIFIER (1)
// Uncomment this to get some useful serial debug info (Serial.print and Serial.println expected)
//#define DEBUG_SIGNING
@@ -72,15 +74,14 @@ MySigningAtsha204Soft::MySigningAtsha204Soft(bool requestSignatures,
uint8_t randomseedPin)
:
MySigning(requestSignatures),
rndPin(randomseedPin),
#ifdef MY_SECURE_NODE_WHITELISTING
whitlist_sz(nof_whitelist_entries),
whitelist(the_whitelist),
node_serial_info(the_serial),
#endif
Sha256(),
verification_ongoing(false),
Sha256()
rndPin(randomseedPin)
{
}
@@ -37,8 +37,6 @@
#include "utility/sha256.h"
#include <stdint.h>
#define SIGNING_IDENTIFIER (1)
#ifdef MY_SECURE_NODE_WHITELISTING
typedef struct {
uint8_t nodeId;
+4
View File
@@ -29,6 +29,8 @@
#include "MySigning.h"
#include "MySigningNone.h"
#define SIGNING_IDENTIFIER (0)
// Uncomment this to get some useful serial debug info (Serial.print and Serial.println expected)
//#define DEBUG_SIGNING
@@ -61,6 +63,7 @@ MySigningNone::MySigningNone() : MySigning() {
}
bool MySigningNone::getNonce(MyMessage &msg) {
(void)msg;
return true;
}
@@ -69,6 +72,7 @@ bool MySigningNone::checkTimer() {
}
bool MySigningNone::putNonce(MyMessage &msg) {
(void)msg;
return true;
}
-2
View File
@@ -32,8 +32,6 @@
#include "MySigning.h"
#include <stdint.h>
#define SIGNING_IDENTIFIER (0)
// The "none" signing driver that can be used for nodes
// not requiring signing
// It does check SIGNING_IDENTIFIER byte to avoid illegal mixing of signing back-ends in
+1
View File
@@ -74,6 +74,7 @@ bool MyTransportNRF24::send(uint8_t to, const void* data, uint8_t len) {
bool MyTransportNRF24::available(uint8_t *to) {
uint8_t pipe = 255;
boolean avail = rf24.available(&pipe);
(void)avail; //until somebody makes use of 'avail'
if (pipe == CURRENT_NODE_PIPE)
*to = _address;
else if (pipe == BROADCAST_PIPE)
@@ -30,8 +30,6 @@
#include <SPI.h>
#include <MySensor.h>
#define DEBUG 1 // Debug enables Serial.print 1 = Yes 0 = No
int BATTERY_SENSE_PIN = A0; // select the input pin for the battery sense point
MySensor gw;
@@ -41,7 +39,11 @@ int oldBatteryPcnt = 0;
void setup()
{
// use the 1.1 V internal reference
#if defined(__AVR_ATmega2560__)
analogReference(INTERNAL1V1);
#else
analogReference(INTERNAL);
#endif
gw.begin();
// Send the sketch version information to the gateway and Controller
@@ -52,7 +54,7 @@ void loop()
{
// get the battery Voltage
int sensorValue = analogRead(BATTERY_SENSE_PIN);
#if DEBUG > 0
#ifdef DEBUG
Serial.println(sensorValue);
#endif
@@ -63,7 +65,7 @@ void loop()
float batteryV = sensorValue * 0.003363075;
int batteryPcnt = sensorValue / 10;
#if DEBUG > 0
#ifdef DEBUG
Serial.print("Battery Voltage: ");
Serial.print(batteryV);
Serial.println(" V");
@@ -191,7 +191,7 @@ void setup()
//check for saved date in EEPROM
DEBUG_PRINTLN(F("Checking EEPROM for stored date:"));
delay(500);
if (gw.loadState(0) == 0xFF); // EEPROM flag
if (gw.loadState(0) == 0xFF) // EEPROM flag
{
DEBUG_PRINTLN(F("Retreiving last run time from EEPROM..."));
for (int i = 0; i < 4 ; i++)
@@ -439,7 +439,7 @@ void loop()
state = STAND_BY_ALL_OFF;
}
}
else if (state = ZONE_SELECT_MENU)
else if (state == ZONE_SELECT_MENU)
{
displayMenu();
}
@@ -771,6 +771,9 @@ void updateDisplay()
lcd.print(totalTimeRan);
lcd.print(" Minutes ");
}
default:
// what of ZONE_SELECT_MENU?
break;
}
lastUpdateTime = millis();
}
@@ -88,8 +88,8 @@ void loop()
// If no time has been received yet, request it every 10 second from controller
// When time has been received, request update every hour
if ((!timeReceived && now-lastRequest > 10*1000)
|| (timeReceived && now-lastRequest > 60*1000*60)) {
if ((!timeReceived && now-lastRequest > (unsigned long)(10*1000))
|| (timeReceived && now-lastRequest > (unsigned long)(60*1000*60))) {
// Request time from controller.
Serial.println("requesting time");
gw.requestTime(receiveTime);
@@ -85,7 +85,7 @@ void setup()
// Fetch lock status
for (int lock=1, pin=LOCK_1; lock<=NOF_LOCKS;lock++, pin++) {
// Register all locks to gw (they will be created as child devices)
gw.present(lock, S_LOCK, false);
gw.present(lock, S_LOCK, "SecureActuator", false);
// Then set lock pins in output mode
pinMode(pin, OUTPUT);
// Set lock to last known state (using eeprom storage)
@@ -77,17 +77,19 @@ int RESEND_DEBOUNCE = 2000; // Number of millisecons interval between sending of
// Add your buttons here. Max is 5 if you still want time at the top.
char *buttons[] = {
"Good Morning",
"Clean Up!",
"All Lights Off",
"Music On/Off"
(char *)"Good Morning",
(char *)"Clean Up!",
(char *)"All Lights Off",
(char *)"Music On/Off"
};
const int buttonCount = sizeof(buttons)/sizeof(char *);
const int padding = 10;
const int topBarHeight = 60;
MySensor gw(17,18);
MyTransportNRF24 radio; // NRFRF24L01 radio driver
MyHwATMega328 hw; // Select AtMega328 hardware profile
MySensor gw(radio, hw);
MyMessage on(CHILD_ID, V_SCENE_ON);
MyMessage off(CHILD_ID, V_SCENE_OFF);
@@ -142,13 +144,12 @@ void loop()
unsigned long now = millis();
if (myTouch.dataAvailable()) {
unsigned long startPress = millis();
int pressedButton = myButtons.checkButtons();
if (pressedButton>=0) {
bool longPress = millis()-now>LONG_PRESS;
bool longPress = millis()-now>(unsigned long)LONG_PRESS;
if (pressedButton != lastPressedButton || now-lastPressedButtonTime > RESEND_DEBOUNCE) {
if (pressedButton != lastPressedButton || now-lastPressedButtonTime > (unsigned long)RESEND_DEBOUNCE) {
if (longPress) {
gw.send(off.set(pressedButton));
Serial.print("Long pressed: ");
@@ -165,8 +166,8 @@ void loop()
// If no time has been received yet, request it every 10 second from controller
// When time has been received, request update every hour
if ((!timeReceived && now-lastRequest > 10*1000)
|| (timeReceived && now-lastRequest > 60*1000*60)) {
if ((!timeReceived && now-lastRequest > (unsigned long)10*1000)
|| (timeReceived && now-lastRequest > (unsigned long)60*1000*60)) {
// Request time from controller.
Serial.println("requesting time");
gw.requestTime(receiveTime);
+2 -1
View File
@@ -463,7 +463,8 @@ uint8_t ATSHA204Class::sha204m_execute(uint8_t op_code, uint8_t param1, uint16_t
uint8_t poll_delay, poll_timeout, response_size;
uint8_t *p_buffer;
uint8_t len;
(void)tx_size;
// Supply delays and response size.
switch (op_code)
{
+1 -1
View File
@@ -41,7 +41,7 @@ void RF24::csn(bool mode)
delayMicroseconds(11); // allow csn to settle
}
}
#else if !defined (__arm__) || defined (CORE_TEENSY)
#elif !defined (__arm__) || defined (CORE_TEENSY)
digitalWrite(csn_pin,mode);
#endif
+3 -3
View File
@@ -55,9 +55,9 @@ bool RFM69::initialize(byte freqBand, byte nodeID, byte networkID)
/* 0x05 */ { REG_FDEVMSB, RF_FDEVMSB_50000}, //default:5khz, (FDEV + BitRate/2 <= 500Khz)
/* 0x06 */ { REG_FDEVLSB, RF_FDEVLSB_50000},
/* 0x07 */ { REG_FRFMSB, (freqBand==RF69_315MHZ ? RF_FRFMSB_315 : (freqBand==RF69_433MHZ ? RF_FRFMSB_433 : (freqBand==RF69_868MHZ ? RF_FRFMSB_868 : RF_FRFMSB_915))) },
/* 0x08 */ { REG_FRFMID, (freqBand==RF69_315MHZ ? RF_FRFMID_315 : (freqBand==RF69_433MHZ ? RF_FRFMID_433 : (freqBand==RF69_868MHZ ? RF_FRFMID_868 : RF_FRFMID_915))) },
/* 0x09 */ { REG_FRFLSB, (freqBand==RF69_315MHZ ? RF_FRFLSB_315 : (freqBand==RF69_433MHZ ? RF_FRFLSB_433 : (freqBand==RF69_868MHZ ? RF_FRFLSB_868 : RF_FRFLSB_915))) },
/* 0x07 */ { REG_FRFMSB, (freqBand==RF69_315MHZ ? (const byte)RF_FRFMSB_315 : (freqBand==RF69_433MHZ ? (const byte)RF_FRFMSB_433 : (freqBand==RF69_868MHZ ? (const byte)RF_FRFMSB_868 : (const byte)RF_FRFMSB_915))) },
/* 0x08 */ { REG_FRFMID, (freqBand==RF69_315MHZ ? (const byte)RF_FRFMID_315 : (freqBand==RF69_433MHZ ? (const byte)RF_FRFMID_433 : (freqBand==RF69_868MHZ ? (const byte)RF_FRFMID_868 : (const byte)RF_FRFMID_915))) },
/* 0x09 */ { REG_FRFLSB, (freqBand==RF69_315MHZ ? (const byte)RF_FRFLSB_315 : (freqBand==RF69_433MHZ ? (const byte)RF_FRFLSB_433 : (freqBand==RF69_868MHZ ? (const byte)RF_FRFLSB_868 : (const byte)RF_FRFLSB_915))) },
// looks like PA1 and PA2 are not implemented on RFM69W, hence the max output power is 13dBm
// +17dBm and +20dBm are possible on RFM69HW
+5 -3
View File
@@ -61,6 +61,7 @@ void PN532::begin()
/**************************************************************************/
void PN532::PrintHex(const uint8_t *data, const uint32_t numBytes)
{
(void)data;
for (uint8_t i = 0; i < numBytes; i++) {
DMSG("0x");
DMSG_HEX(data[i]);
@@ -86,11 +87,11 @@ void PN532::PrintHexChar(const uint8_t *data, const uint32_t numBytes)
}
DMSG(" ");
for (uint8_t i = 0; i < numBytes; i++) {
char c = data[i];
uint8_t c = data[i];
if (c <= 0x1f || c > 0x7f) {
DMSG('.');
} else {
DMSG(c);
DMSG((char)c);
}
}
@@ -548,7 +549,7 @@ uint8_t PN532::mifareclassic_WriteNDEFURI (uint8_t sectorNumber, uint8_t uriIden
// in NDEF records
// Setup the sector buffer (w/pre-formatted TLV wrapper and NDEF message)
uint8_t sectorbuffer1[16] = {0x00, 0x00, 0x03, len + 5, 0xD1, 0x01, len + 1, 0x55, uriIdentifier, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
uint8_t sectorbuffer1[16] = {0x00, 0x00, 0x03, (uint8_t)(len + 5), 0xD1, 0x01, (uint8_t)(len + 1), 0x55, uriIdentifier, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
uint8_t sectorbuffer2[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
uint8_t sectorbuffer3[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
uint8_t sectorbuffer4[16] = {0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7, 0x7F, 0x07, 0x88, 0x40, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
@@ -653,6 +654,7 @@ uint8_t PN532::mifareultralight_ReadPage (uint8_t page, uint8_t *buffer)
bool PN532::inDataExchange(uint8_t *send, uint8_t sendLength, uint8_t *response, uint8_t *responseLength)
{
uint8_t i;
(void)i;
pn532_packetbuffer[0] = 0x40; // PN532_COMMAND_INDATAEXCHANGE;
pn532_packetbuffer[1] = inListedTag;
+4 -1
View File
@@ -37,6 +37,7 @@ int8_t LLCP::activate(uint16_t timeout)
int8_t LLCP::waitForConnection(uint16_t timeout)
{
uint8_t type;
(void)timeout;
sequence = 0;
@@ -76,6 +77,7 @@ int8_t LLCP::waitForConnection(uint16_t timeout)
int8_t LLCP::waitForDisconnection(uint16_t timeout)
{
uint8_t type;
(void)timeout;
// Get DISC PDU
DMSG("wait for a DISC PDU\n");
@@ -113,6 +115,7 @@ int8_t LLCP::waitForDisconnection(uint16_t timeout)
int8_t LLCP::connect(uint16_t timeout)
{
uint8_t type;
(void)timeout;
sequence = 0;
@@ -165,6 +168,7 @@ int8_t LLCP::connect(uint16_t timeout)
int8_t LLCP::disconnect(uint16_t timeout)
{
uint8_t type;
(void)timeout;
// try to get a SYMM PDU
if (2 > link.read(headerBuf, headerBufLen)) {
@@ -207,7 +211,6 @@ int8_t LLCP::disconnect(uint16_t timeout)
bool LLCP::write(const uint8_t *header, uint8_t hlen, const uint8_t *body, uint8_t blen)
{
uint8_t type;
uint8_t buf[3];
if (2 != link.read(buf, sizeof(buf))) {
+1 -1
View File
@@ -79,7 +79,7 @@ int16_t SNEP::read(uint8_t *buf, uint8_t len, uint16_t timeout)
}
// check message's length
uint32_t length = (buf[2] << 24) + (buf[3] << 16) + (buf[4] << 8) + buf[5];
uint32_t length = ((uint32_t)buf[2] << 24) + ((uint32_t)buf[3] << 16) + (buf[4] << 8) + buf[5];
// length should not be more than 244 (header + body < 255, header = 6 + 3 + 2)
if (length > (status - 6)) {
DMSG("The SNEP message is too large\n");
@@ -78,15 +78,8 @@ uint8_t PWF_AS3935::_sing_reg_read(uint8_t RegAdd)
void PWF_AS3935::_sing_reg_write(uint8_t RegAdd, uint8_t DataMask, uint8_t RegData)
{
// start by reading original register data (only modifying what we need to)
uint8_t OrigRegData = _sing_reg_read(RegAdd);
// calculate new register data... 'delete' old targeted data, replace with new data
// note: 'DataMask' must be bits targeted for replacement
// add'l note: this function does NOT shift values into the proper place... they need to be there already
uint8_t NewRegData = ((OrigRegData & ~DataMask) | (RegData & DataMask));
// now configure and write the updated register value
(void)DataMask;
// Configure and write the updated register value
digitalWrite(_cs, LOW); // set pin low to start talking to IC
// next pack command byte, send AS3935.... structure is shown below
// MODE Register Address/Direct Cmd
@@ -228,7 +221,7 @@ uint32_t PWF_AS3935::AS3935_GetStrikeEnergyRaw(void)
{
uint32_t nrgy_raw = ((_sing_reg_read(0x06) & 0x1F) << 8); // MMSB, shift 8 bits left, make room for MSB
nrgy_raw |= _sing_reg_read(0x05); // read MSB
nrgy_raw <= 8; // shift 8 bits left, make room for LSB
nrgy_raw <<= 8; // shift 8 bits left, make room for LSB
nrgy_raw |= _sing_reg_read(0x04); // read LSB, add to others
return nrgy_raw;
+2 -1
View File
@@ -474,7 +474,8 @@ void PCintPort::detachInterrupt(uint8_t arduinoPin)
// there isn't really a good way to back-map ports and masks to pins.
void PCintPort::PCint() {
uint8_t thisChangedPin; //MIKE
(void)thisChangedPin;
#ifdef FLASH
if (*led_port & led_mask) *led_port&=not_led_mask;
else *led_port|=led_mask;
@@ -230,6 +230,7 @@ unsigned long KaKuTransmitter::getTelegram(char address, byte device, boolean on
}
void KaKuTransmitter::sendSignal(char address, byte group, byte device, boolean on) {
(void)device;
sendTelegram(getTelegram(address, group, on), _pin);
}
+6 -6
View File
@@ -854,8 +854,8 @@ void UTFT::printChar(byte c, int x, int y)
{
setXY(x,y,x+cfont.x_size-1,y+cfont.y_size-1);
temp=((c-cfont.offset)*((cfont.x_size/8)*cfont.y_size))+4;
for(j=0;j<((cfont.x_size/8)*cfont.y_size);j++)
temp=(word)((c-cfont.offset)*((cfont.x_size/8)*cfont.y_size))+4;
for(j=0;j<(word)((cfont.x_size/8)*cfont.y_size);j++)
{
ch=pgm_read_byte(&cfont.font[temp]);
for(i=0;i<8;i++)
@@ -876,7 +876,7 @@ void UTFT::printChar(byte c, int x, int y)
{
temp=((c-cfont.offset)*((cfont.x_size/8)*cfont.y_size))+4;
for(j=0;j<((cfont.x_size/8)*cfont.y_size);j+=(cfont.x_size/8))
for(j=0;j<(word)((cfont.x_size/8)*cfont.y_size);j+=(cfont.x_size/8))
{
setXY(x,y+(j/(cfont.x_size/8)),x+cfont.x_size-1,y+(j/(cfont.x_size/8)));
for (int zz=(cfont.x_size/8)-1; zz>=0; zz--)
@@ -1080,7 +1080,7 @@ void UTFT::printNumF(double num, byte dec, int x, int y, char divider, int lengt
if (divider != '.')
{
for (int i=0; i<sizeof(st); i++)
for (unsigned int i=0; i<sizeof(st); i++)
if (st[i]=='.')
st[i]=divider;
}
@@ -1090,13 +1090,13 @@ void UTFT::printNumF(double num, byte dec, int x, int y, char divider, int lengt
if (neg)
{
st[0]='-';
for (int i=1; i<sizeof(st); i++)
for (unsigned int i=1; i<sizeof(st); i++)
if ((st[i]==' ') || (st[i]=='-'))
st[i]=filler;
}
else
{
for (int i=0; i<sizeof(st); i++)
for (unsigned int i=0; i<sizeof(st); i++)
if (st[i]==' ')
st[i]=filler;
}
+2 -2
View File
@@ -194,7 +194,7 @@ void UTFT_Buttons::deleteAllButtons()
buttons[i].width=0;
buttons[i].height=0;
buttons[i].flags=BUTTON_UNUSED;
buttons[i].label="";
buttons[i].label[0]='\0';
}
}
@@ -212,7 +212,7 @@ int UTFT_Buttons::checkButtons()
{
if (((buttons[i].flags & BUTTON_UNUSED) == 0) and ((buttons[i].flags & BUTTON_DISABLED) == 0) and (result == -1))
{
if ((touch_x >= buttons[i].pos_x) and (touch_x <= (buttons[i].pos_x + buttons[i].width)) and (touch_y >= buttons[i].pos_y) and (touch_y <= (buttons[i].pos_y + buttons[i].height)))
if ((touch_x >= (int)buttons[i].pos_x) and (touch_x <= (int)(buttons[i].pos_x + buttons[i].width)) and (touch_y >= (int)buttons[i].pos_y) and (touch_y <= (int)(buttons[i].pos_y + buttons[i].height)))
result = i;
}
}
+13
View File
@@ -791,6 +791,19 @@ uint8_t atsha204Class::sha204m_check_parameters(uint8_t op_code, uint8_t param1,
return SHA204_SUCCESS;
#else
(void)rx_size;
(void)tx_size;
(void)tx_buffer;
(void)rx_buffer;
(void)param1;
(void)param2;
(void)data1;
(void)data2;
(void)data3;
(void)datalen1;
(void)datalen2;
(void)datalen3;
(void)op_code;
return SHA204_SUCCESS;
#endif
}