From 62b735c9074c387b86a401bf18a17248d4bcf360 Mon Sep 17 00:00:00 2001 From: elral <3263285+elral@users.noreply.github.com> Date: Sat, 23 Oct 2021 09:51:49 +0200 Subject: [PATCH 1/4] missing void for begin() --- src/LedControl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LedControl.cpp b/src/LedControl.cpp index 2fe2e235..7722e8c4 100644 --- a/src/LedControl.cpp +++ b/src/LedControl.cpp @@ -45,7 +45,7 @@ LedControl::LedControl() {} -LedControl::begin(int dataPin, int clkPin, int csPin, int numDevices) { +void LedControl::begin(int dataPin, int clkPin, int csPin, int numDevices) { SPI_MOSI=dataPin; SPI_CLK=clkPin; SPI_CS=csPin; From 6a231c7aa13b37cb19d0a2f545a2206d90da0443 Mon Sep 17 00:00:00 2001 From: elral <3263285+elral@users.noreply.github.com> Date: Tue, 11 Jan 2022 09:28:21 +0100 Subject: [PATCH 2/4] Avoid warning of unused variable "offset" --- src/LedControl.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/LedControl.cpp b/src/LedControl.cpp index ced71085..bd43b757 100644 --- a/src/LedControl.cpp +++ b/src/LedControl.cpp @@ -97,11 +97,11 @@ void LedControl::setIntensity(int addr, int intensity) { } void LedControl::clearDisplay(int addr) { - int offset; - if(addr<0 || addr>=maxDevices) return; - offset=addr*8; +#ifndef MF_REDUCE_FUNCT_LEDCONTROL + int offset=addr*8; +#endif for(int i=0;i<8;i++) { #ifndef MF_REDUCE_FUNCT_LEDCONTROL status[offset+i]=0; @@ -160,14 +160,14 @@ void LedControl::setColumn(int addr, int col, byte value) { #endif void LedControl::setDigit(int addr, int digit, byte value, boolean dp) { - int offset; - byte v; - if(addr<0 || addr>=maxDevices) return; if(digit<0 || digit>7 || value>15) return; - offset=addr*8; +#ifndef MF_REDUCE_FUNCT_LEDCONTROL + int offset=addr*8; +#endif + byte v; v=pgm_read_byte_near(charTable + value); if(dp) v|=B10000000; @@ -178,14 +178,15 @@ void LedControl::setDigit(int addr, int digit, byte value, boolean dp) { } void LedControl::setChar(int addr, int digit, char value, boolean dp) { - int offset; - byte index,v; - if(addr<0 || addr>=maxDevices) return; if(digit<0 || digit>7) return; - offset=addr*8; +#ifndef MF_REDUCE_FUNCT_LEDCONTROL + int offset=addr*8; +#endif + byte index,v; + index=(byte)value; if(index >127) { //nothing define we use the space char From c378081e2e2d59b39b92b4430e17dfa3e5f1dea2 Mon Sep 17 00:00:00 2001 From: elral <3263285+elral@users.noreply.github.com> Date: Tue, 25 Jan 2022 08:45:41 +0100 Subject: [PATCH 3/4] B for binary format is depracated, use instead 0b --- src/LedControl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LedControl.cpp b/src/LedControl.cpp index bd43b757..8ae48242 100644 --- a/src/LedControl.cpp +++ b/src/LedControl.cpp @@ -123,7 +123,7 @@ void LedControl::setLed(int addr, int row, int column, boolean state) { if(row<0 || row>7 || column<0 || column>7) return; offset=addr*8; - val=B10000000 >> column; + val=0b10000000 >> column; if(state) status[offset+row]=status[offset+row]|val; else { @@ -170,7 +170,7 @@ void LedControl::setDigit(int addr, int digit, byte value, boolean dp) { byte v; v=pgm_read_byte_near(charTable + value); if(dp) - v|=B10000000; + v|=0b10000000; #ifndef MF_REDUCE_FUNCT_LEDCONTROL status[offset+digit]=v; #endif @@ -194,7 +194,7 @@ void LedControl::setChar(int addr, int digit, char value, boolean dp) { } v=pgm_read_byte_near(charTable + index); if(dp) - v|=B10000000; + v|=0b10000000; #ifndef MF_REDUCE_FUNCT_LEDCONTROL status[offset+digit]=v; #endif From 6879365d06aea371e675b7f08b0be2b186cf9d89 Mon Sep 17 00:00:00 2001 From: elral <3263285+elral@users.noreply.github.com> Date: Wed, 16 Nov 2022 09:13:19 +0100 Subject: [PATCH 4/4] gets included by --- src/LedControl.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/LedControl.h b/src/LedControl.h index cc1729a8..dfd8559b 100644 --- a/src/LedControl.h +++ b/src/LedControl.h @@ -27,13 +27,7 @@ #ifndef LedControl_h #define LedControl_h -#include - -#if (ARDUINO >= 100) #include -#else -#include -#endif /* * Segments to be switched on for characters and digits on