@@ -346,6 +346,8 @@ bool Wippersnapper::configureDigitalPinReq(
346
346
/* ****************************************************************************/
347
347
bool cbDecodePinConfigMsg (pb_istream_t *stream, const pb_field_t *field,
348
348
void **arg) {
349
+ (void )field; // marking unused parameters to avoid compiler warning
350
+ (void )arg; // marking unused parameters to avoid compiler warning
349
351
bool is_success = true ;
350
352
WS_DEBUG_PRINTLN (" cbDecodePinConfigMsg" );
351
353
@@ -386,6 +388,8 @@ bool cbDecodePinConfigMsg(pb_istream_t *stream, const pb_field_t *field,
386
388
bool cbDecodeDigitalPinWriteMsg (pb_istream_t *stream, const pb_field_t *field,
387
389
void **arg) {
388
390
bool is_success = true ;
391
+ (void )field; // marking unused parameters to avoid compiler warning
392
+ (void )arg; // marking unused parameters to avoid compiler warning
389
393
WS_DEBUG_PRINTLN (" cbDecodeDigitalPinWriteMsg" );
390
394
391
395
// Decode stream into a PinEvent
@@ -417,6 +421,7 @@ bool cbDecodeDigitalPinWriteMsg(pb_istream_t *stream, const pb_field_t *field,
417
421
*/
418
422
/* *************************************************************************/
419
423
bool cbSignalMsg (pb_istream_t *stream, const pb_field_t *field, void **arg) {
424
+ (void )arg; // marking unused parameters to avoid compiler warning
420
425
bool is_success = true ;
421
426
WS_DEBUG_PRINTLN (" cbSignalMsg" );
422
427
@@ -567,15 +572,11 @@ bool encodeI2CResponse(wippersnapper_signal_v1_I2CResponse *msgi2cResponse) {
567
572
@brief Initializes an I2C bus component
568
573
@param msgInitRequest
569
574
A pointer to an i2c bus initialization message.
570
- @param i2cPort
571
- Desired I2C port to initialize.
572
575
@return True if initialized successfully, False otherwise.
573
576
*/
574
577
/* *****************************************************************************************/
575
- bool initializeI2CBus (wippersnapper_i2c_v1_I2CBusInitRequest msgInitRequest,
576
- int i2cPort) {
577
- // TODO: i2cPort is not handled right now, we should add support for multiple
578
- // i2c ports!
578
+ bool initializeI2CBus (wippersnapper_i2c_v1_I2CBusInitRequest msgInitRequest) {
579
+ // FUTURE TODO:we should add support for multiple i2c ports!
579
580
if (WS._isI2CPort0Init )
580
581
return true ;
581
582
// Initialize bus
@@ -599,6 +600,8 @@ bool initializeI2CBus(wippersnapper_i2c_v1_I2CBusInitRequest msgInitRequest,
599
600
/* *****************************************************************************************/
600
601
bool cbDecodeI2CDeviceInitRequestList (pb_istream_t *stream,
601
602
const pb_field_t *field, void **arg) {
603
+ (void )field; // marking unused parameters to avoid compiler warning
604
+ (void )arg; // marking unused parameters to avoid compiler warning
602
605
WS_DEBUG_PRINTLN (" EXEC: cbDecodeI2CDeviceInitRequestList" );
603
606
// Decode stream into individual msgI2CDeviceInitRequest messages
604
607
wippersnapper_i2c_v1_I2CDeviceInitRequest msgI2CDeviceInitRequest =
@@ -616,7 +619,7 @@ bool cbDecodeI2CDeviceInitRequestList(pb_istream_t *stream,
616
619
wippersnapper_signal_v1_I2CResponse_resp_i2c_device_init_tag;
617
620
618
621
// Check I2C bus
619
- if (!initializeI2CBus (msgI2CDeviceInitRequest.i2c_bus_init_req , 0 )) {
622
+ if (!initializeI2CBus (msgI2CDeviceInitRequest.i2c_bus_init_req )) {
620
623
WS_DEBUG_PRINTLN (" ERROR: Failed to initialize I2C Bus" );
621
624
msgi2cResponse.payload .resp_i2c_device_init .bus_response =
622
625
WS._i2cPort0 ->getBusStatus ();
@@ -664,6 +667,7 @@ bool cbDecodeI2CDeviceInitRequestList(pb_istream_t *stream,
664
667
bool cbDecodeSignalRequestI2C (pb_istream_t *stream, const pb_field_t *field,
665
668
void **arg) {
666
669
bool is_success = true ;
670
+ (void )arg; // marking unused parameter to avoid compiler warning
667
671
WS_DEBUG_PRINTLN (" cbDecodeSignalRequestI2C" );
668
672
// Create I2C Response
669
673
wippersnapper_signal_v1_I2CResponse msgi2cResponse =
@@ -687,7 +691,7 @@ bool cbDecodeSignalRequestI2C(pb_istream_t *stream, const pb_field_t *field,
687
691
wippersnapper_i2c_v1_I2CBusScanResponse_init_zero;
688
692
689
693
// Check I2C bus
690
- if (!initializeI2CBus (msgScanReq.bus_init_request , 0 )) {
694
+ if (!initializeI2CBus (msgScanReq.bus_init_request )) {
691
695
WS_DEBUG_PRINTLN (" ERROR: Failed to initialize I2C Bus" );
692
696
msgi2cResponse.payload .resp_i2c_scan .bus_response =
693
697
WS._i2cPort0 ->getBusStatus ();
@@ -756,7 +760,7 @@ bool cbDecodeSignalRequestI2C(pb_istream_t *stream, const pb_field_t *field,
756
760
wippersnapper_signal_v1_I2CResponse_resp_i2c_device_init_tag;
757
761
758
762
// Check I2C bus
759
- if (!initializeI2CBus (msgI2CDeviceInitRequest.i2c_bus_init_req , 0 )) {
763
+ if (!initializeI2CBus (msgI2CDeviceInitRequest.i2c_bus_init_req )) {
760
764
WS_DEBUG_PRINTLN (" ERROR: Failed to initialize I2C Bus" );
761
765
msgi2cResponse.payload .resp_i2c_device_init .bus_response =
762
766
WS._i2cPort0 ->getBusStatus ();
@@ -904,6 +908,7 @@ void cbSignalI2CReq(char *data, uint16_t len) {
904
908
bool cbDecodeServoMsg (pb_istream_t *stream, const pb_field_t *field,
905
909
void **arg) {
906
910
WS_DEBUG_PRINTLN (" Decoding Servo Message..." );
911
+ (void )arg; // marking unused parameter to avoid compiler warning
907
912
if (field->tag == wippersnapper_signal_v1_ServoRequest_servo_attach_tag) {
908
913
WS_DEBUG_PRINTLN (" GOT: Servo Attach" );
909
914
// Attempt to decode contents of servo_attach message
@@ -1082,6 +1087,7 @@ void cbServoMsg(char *data, uint16_t len) {
1082
1087
/* *****************************************************************************************/
1083
1088
bool cbPWMDecodeMsg (pb_istream_t *stream, const pb_field_t *field, void **arg) {
1084
1089
WS_DEBUG_PRINTLN (" Decoding PWM Message..." );
1090
+ (void )arg; // marking unused parameter to avoid compiler warning
1085
1091
if (field->tag == wippersnapper_signal_v1_PWMRequest_attach_request_tag) {
1086
1092
WS_DEBUG_PRINTLN (" GOT: PWM Pin Attach" );
1087
1093
// Attempt to decode contents of PWM attach message
@@ -1286,6 +1292,7 @@ void cbPWMMsg(char *data, uint16_t len) {
1286
1292
/* *****************************************************************************************/
1287
1293
bool cbDecodeDs18x20Msg (pb_istream_t *stream, const pb_field_t *field,
1288
1294
void **arg) {
1295
+ (void )arg; // marking unused parameter to avoid compiler warning
1289
1296
if (field->tag ==
1290
1297
wippersnapper_signal_v1_Ds18x20Request_req_ds18x20_init_tag) {
1291
1298
WS_DEBUG_PRINTLN (" [Message Type] Init. DS Sensor" );
@@ -1373,6 +1380,7 @@ void cbSignalDSReq(char *data, uint16_t len) {
1373
1380
/* *****************************************************************************************/
1374
1381
bool cbDecodePixelsMsg (pb_istream_t *stream, const pb_field_t *field,
1375
1382
void **arg) {
1383
+ (void )arg; // marking unused parameter to avoid compiler warning
1376
1384
if (field->tag ==
1377
1385
wippersnapper_signal_v1_PixelsRequest_req_pixels_create_tag) {
1378
1386
WS_DEBUG_PRINTLN (
@@ -1528,6 +1536,7 @@ void cbRegistrationStatus(char *data, uint16_t len) {
1528
1536
*/
1529
1537
/* *************************************************************************/
1530
1538
void cbErrorTopic (char *errorData, uint16_t len) {
1539
+ (void )len; // marking unused parameter to avoid compiler warning
1531
1540
WS_DEBUG_PRINT (" IO Ban Error: " );
1532
1541
WS_DEBUG_PRINTLN (errorData);
1533
1542
// Disconnect client from broker
@@ -1558,6 +1567,7 @@ void cbErrorTopic(char *errorData, uint16_t len) {
1558
1567
*/
1559
1568
/* *************************************************************************/
1560
1569
void cbThrottleTopic (char *throttleData, uint16_t len) {
1570
+ (void )len; // marking unused parameter to avoid compiler warning
1561
1571
WS_DEBUG_PRINT (" IO Throttle Error: " );
1562
1572
WS_DEBUG_PRINTLN (throttleData);
1563
1573
char *throttleMessage;
0 commit comments