Skip to content

Commit

Permalink
Merge pull request letscontrolit#5000 from TD-er/bugfix/JL1101_Ethernet
Browse files Browse the repository at this point in the history
[JL1101] Fix JL1101 Ethernet + update to latest ESP-IDF5.1 code
  • Loading branch information
TD-er authored Mar 6, 2024
2 parents d6514ec + d0d6782 commit 87c1d6a
Show file tree
Hide file tree
Showing 18 changed files with 177 additions and 176 deletions.
80 changes: 40 additions & 40 deletions lib/Adafruit_NeoMatrix/examples/MatrixGFXDemo/MatrixGFXDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -150,56 +150,56 @@ static const uint8_t PROGMEM
mono_bmp[][8] =
{
{ // 0: checkered 1
B10101010,
B01010101,
B10101010,
B01010101,
B10101010,
B01010101,
B10101010,
B01010101,
0b10101010,
0b01010101,
0b10101010,
0b01010101,
0b10101010,
0b01010101,
0b10101010,
0b01010101,
},

{ // 1: checkered 2
B01010101,
B10101010,
B01010101,
B10101010,
B01010101,
B10101010,
B01010101,
B10101010,
0b01010101,
0b10101010,
0b01010101,
0b10101010,
0b01010101,
0b10101010,
0b01010101,
0b10101010,
},

{ // 2: smiley
B00111100,
B01000010,
B10100101,
B10000001,
B10100101,
B10011001,
B01000010,
B00111100 },
0b00111100,
0b01000010,
0b10100101,
0b10000001,
0b10100101,
0b10011001,
0b01000010,
0b00111100 },

{ // 3: neutral
B00111100,
B01000010,
B10100101,
B10000001,
B10111101,
B10000001,
B01000010,
B00111100 },
0b00111100,
0b01000010,
0b10100101,
0b10000001,
0b10111101,
0b10000001,
0b01000010,
0b00111100 },

{ // 4; frowny
B00111100,
B01000010,
B10100101,
B10000001,
B10011001,
B10100101,
B01000010,
B00111100 },
0b00111100,
0b01000010,
0b10100101,
0b10000001,
0b10011001,
0b10100101,
0b01000010,
0b00111100 },
};

static const uint16_t PROGMEM
Expand Down
34 changes: 17 additions & 17 deletions lib/HeatpumpIR/ZHJG01HeatpumpIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,30 +108,30 @@ void ZHJG01HeatpumpIR::sendZHJG01(IRSender& IR,

/********************************************************************************
* Byte[0]: Turbo, Eco, Fan, Vertical Swing
* TURBO ON: B0x1xxxxx
* ECO ON: B0x0xxxxx
* TURBO/ECO OFF: B1xxxxxxx
* FAN1: Bx00xxxxx
* FAN2: Bx01xxxxx
* FAN3: Bx10xxxxx
* FAN AUTO: Bx11xxxxx
* VERTICAL FIXED: Bxxx01xxx
* VERTICAL SWING: Bxxx10xxx
* VERTICAL WIND: Bxxx11xxx
* TURBO ON: 0b0x1xxxxx
* ECO ON: 0b0x0xxxxx
* TURBO/ECO OFF: 0b1xxxxxxx
* FAN1: 0bx00xxxxx
* FAN2: 0bx01xxxxx
* FAN3: 0bx10xxxxx
* FAN AUTO: 0bx11xxxxx
* VERTICAL FIXED: 0bxxx01xxx
* VERTICAL SWING: 0bxxx10xxx
* VERTICAL WIND: 0bxxx11xxx
*******************************************************************************/
ZHJG01Template[1] = fanSpeed | swingV;
ZHJG01Template[0] = ~ ZHJG01Template[1];

/********************************************************************************
* Byte[2]: Temp, Power, Mode
* TEMP: Bttttxxxx
* POWER ON: Bxxxx0xxx
* POWER OFF: Bxxxx1xxx
* MODE HEAT: Bxxxxx011
* MODE VENT: Bxxxxx100
* MODE DRY: Bxxxxx101
* MODE COOL: Bxxxxx110
* MODE AUTO: Bxxxxx111
* POWER ON: 0bxxxx0xxx
* POWER OFF: 0bxxxx1xxx
* MODE HEAT: 0bxxxxx011
* MODE VENT: 0bxxxxx100
* MODE DRY: 0bxxxxx101
* MODE COOL: 0bxxxxx110
* MODE AUTO: 0bxxxxx111
*******************************************************************************/

uint8_t tempBits = ((temperature - 17) << 4) & 0b11110000;
Expand Down
6 changes: 3 additions & 3 deletions lib/HeatpumpIR/ZHJG01HeatpumpIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
* Every UNeven Byte (01,03,05,07 and 09) hold a checksum of the corresponding
* command by inverting the bits, for example:
*
* The identifier byte[0] = 0xD5 = B1101 0101
* The checksum byte[1] = 0x2A = B0010 1010
* The identifier byte[0] = 0xD5 = 0b1101 0101
* The checksum byte[1] = 0x2A = 0b0010 1010
*
* So, you can check the message by:
* - inverting the bits of the checksum byte with the corresponding command, they
* should be the same, or
* - Summing up the checksum byte and the corresponding command,
* they should always add up to 0xFF = B11111111 = 255
* they should always add up to 0xFF = 0b11111111 = 255
*
* ******************************************************************************
* Written by: Abílio Costa
Expand Down
34 changes: 17 additions & 17 deletions lib/HeatpumpIR/ZHLT01HeatpumpIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,29 +149,29 @@ void ZHLT01HeatpumpIR::sendZHLT01(IRSender& IR, uint8_t powerMode,

/********************************************************************************
* Byte[07]: POWER, FAN, SLEEP, HORIZONTAL, VERTICAL
* POWER ON: B0xxxxx1x
* POWER OFF: B0xxxxx0x
* VERTICAL SWING: B0xxx01xx
* VERTICAL WIND: B0xxx00xx
* VERTICAL FIXED: B0xxx10xx
* HORIZONTAL SWING: B0xx0xxxx
* HORIZONTAL OFF: B0xx1xxxx
* FAN AUTO: B000xxxx0
* FAN SILENT: B000xxxx1
* FAN3: B001xxxx0
* FAN2: B010xxxx0
* FAN1: B011xxxx0
* POWER ON: 0b0xxxxx1x
* POWER OFF: 0b0xxxxx0x
* VERTICAL SWING: 0b0xxx01xx
* VERTICAL WIND: 0b0xxx00xx
* VERTICAL FIXED: 0b0xxx10xx
* HORIZONTAL SWING: 0b0xx0xxxx
* HORIZONTAL OFF: 0b0xx1xxxx
* FAN AUTO: 0b000xxxx0
* FAN SILENT: 0b000xxxx1
* FAN3: 0b001xxxx0
* FAN2: 0b010xxxx0
* FAN1: 0b011xxxx0
*******************************************************************************/
ZHLT01Template[7] = fanSpeed | powerMode | swingV | swingH;
ZHLT01Template[6] = ~ ZHLT01Template[7];

/********************************************************************************
* Byte[09]: Mode, Temperature
* MODE AUTO: B000xxxxx
* MODE COOL: B001xxxxx
* MODE VENT: B011xxxxx
* MODE DRY: B010xxxxx
* MODE HEAT: B100xxxxx
* MODE AUTO: 0b000xxxxx
* MODE COOL: 0b001xxxxx
* MODE VENT: 0b011xxxxx
* MODE DRY: 0b010xxxxx
* MODE HEAT: 0b100xxxxx
* Temperature is determined by bit0-4:
* 0x00 = 16C
* 0x10 = 32C
Expand Down
6 changes: 3 additions & 3 deletions lib/HeatpumpIR/ZHLT01HeatpumpIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@
* Every EVEN Byte (00,02,04,06,08 and 10) holds a checksum of the corresponding
* command-, or identifier-byte by _inverting_ the bits, for example:
*
* The identifier byte[11] = 0xD5 = B1101 0101
* The checksum byte[10] = 0x2A = B0010 1010
* The identifier byte[11] = 0xD5 = 0b1101 0101
* The checksum byte[10] = 0x2A = 0b0010 1010
*
* So, you can check the message by:
* - inverting the bits of the checksum byte with the corresponding command-, or
* identifier byte, they should me the same, or
* - Summing up the checksum byte and the corresponding command-, or identifier byte,
* they should always add up to 0xFF = B11111111 = 255
* they should always add up to 0xFF = 0b11111111 = 255
*
* Control bytes:
* [01] - Timer (1-24 hours, Off)
Expand Down
2 changes: 1 addition & 1 deletion lib/IRremoteESP8266/examples/LGACSend/LGACSend.ino
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void Ac_Activate(unsigned int temperature, unsigned int air_flow,

// calculating using other values
unsigned int ac_msbits7 = (ac_msbits3 + ac_msbits4 + ac_msbits5 +
ac_msbits6) & B00001111;
ac_msbits6) & 0b00001111;
ac_code_to_sent = ac_msbits1 << 4;
ac_code_to_sent = (ac_code_to_sent + ac_msbits2) << 4;
ac_code_to_sent = (ac_code_to_sent + ac_msbits3) << 4;
Expand Down
2 changes: 1 addition & 1 deletion lib/IRremoteESP8266/src/ir_Gree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ bool IRrecv::decodeGree(decode_results* results, uint16_t offset,
if (used == 0) return false;
offset += used;

// Block #1 footer (3 bits, B010)
// Block #1 footer (3 bits, 0b010)
match_result_t data_result;
data_result = matchData(&(results->rawbuf[offset]), kGreeBlockFooterBits,
kGreeBitMark, kGreeOneSpace, kGreeBitMark,
Expand Down
2 changes: 1 addition & 1 deletion lib/IRremoteESP8266/src/ir_Kelvinator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ bool IRrecv::decodeKelvinator(decode_results *results, uint16_t offset,
offset += used;
pos += 4;

// Command data footer (3 bits, B010)
// Command data footer (3 bits, 0b010)
data_result = matchData(
&(results->rawbuf[offset]), kKelvinatorCmdFooterBits,
kKelvinatorBitMark, kKelvinatorOneSpace,
Expand Down
6 changes: 3 additions & 3 deletions lib/LiquidCrystal_I2C/LiquidCrystal_I2C.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
#define LCD_BACKLIGHT 0x08
#define LCD_NOBACKLIGHT 0x00

#define En B00000100 // Enable bit
#define Rw B00000010 // Read/Write bit
#define Rs B00000001 // Register select bit
#define En 0b00000100 // Enable bit
#define Rw 0b00000010 // Read/Write bit
#define Rs 0b00000001 // Register select bit

class LiquidCrystal_I2C : public Print {
public:
Expand Down
2 changes: 1 addition & 1 deletion lib/RAK12019_LTR390/src/UVlight_LTR390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ bool UVlight_LTR390::init(bool doReset) {
bool UVlight_LTR390::reset(void) {
uint8_t readData = readRegister(LTR390_MAIN_CTRL);

readData |= B00010000;
readData |= 0b00010000;

writeRegister(LTR390_MAIN_CTRL, readData);
delay(10);
Expand Down
18 changes: 9 additions & 9 deletions lib/SparkFun_ADXL345_Arduino_Library/src/SparkFun_ADXL345.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void ADXL345::getRangeSetting(byte *rangeSetting) {
byte _b;

readFrom(ADXL345_DATA_FORMAT, 1, &_b);
*rangeSetting = _b & B00000011;
*rangeSetting = _b & 0b00000011;
}

void ADXL345::setRangeSetting(int val) {
Expand All @@ -208,22 +208,22 @@ void ADXL345::setRangeSetting(int val) {

switch (val) {
case 2:
_s = B00000000;
_s = 0b00000000;
break;
case 4:
_s = B00000001;
_s = 0b00000001;
break;
case 8:
_s = B00000010;
_s = 0b00000010;
break;
case 16:
_s = B00000011;
_s = 0b00000011;
break;
default:
_s = B00000000;
_s = 0b00000000;
}
readFrom(ADXL345_DATA_FORMAT, 1, &_b);
_s |= (_b & B11101100);
_s |= (_b & 0b11101100);
writeTo(ADXL345_DATA_FORMAT, _s);
}

Expand Down Expand Up @@ -700,7 +700,7 @@ double ADXL345::getRate() {
byte _b;

readFrom(ADXL345_BW_RATE, 1, &_b);
_b &= B00001111;
_b &= 0b00001111;
return (pow(2, ((int)_b) - 6)) * 6.25;
}

Expand All @@ -716,7 +716,7 @@ void ADXL345::setRate(double rate) {

if (r <= 9) {
readFrom(ADXL345_BW_RATE, 1, &_b);
_s = (byte)(r + 6) | (_b & B11110000);
_s = (byte)(r + 6) | (_b & 0b11110000);
writeTo(ADXL345_BW_RATE, _s);
}
}
Expand Down
32 changes: 16 additions & 16 deletions lib/esp8266-oled-ssd1306/OLED_SSD1306_SH1106_images.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ const char espeasy_logo_bits[] PROGMEM= {
0x3e, 0x3c, 0x00, 0x3f, 0x1e, 0x1c, 0x00, 0x1e, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

const char activeSymbole[] PROGMEM = {
B00000000,
B00000000,
B00011000,
B00100100,
B01000010,
B01000010,
B00100100,
B00011000
0b00000000,
0b00000000,
0b00011000,
0b00100100,
0b01000010,
0b01000010,
0b00100100,
0b00011000
};

const char inactiveSymbole[] PROGMEM = {
B00000000,
B00000000,
B00000000,
B00000000,
B00011000,
B00011000,
B00000000,
B00000000
0b00000000,
0b00000000,
0b00000000,
0b00000000,
0b00011000,
0b00011000,
0b00000000,
0b00000000
};

#endif
3 changes: 2 additions & 1 deletion platformio_core_defs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,14 @@ lib_ignore =
;platform = https://github.com/Jason2866/platform-espressif32.git
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.02.10/platform-espressif32.zip
;platform_packages =
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2036/framework-arduinoespressif32-release_v5.1-246cad0.zip
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2151/framework-arduinoespressif32-release_v5.1-1a0b6e0.zip
build_flags = -DESP32_STAGE
-DESP_IDF_VERSION_MAJOR=5
-DLIBRARIES_NO_LOG=1
-DDISABLE_SC16IS752_SPI
-DCONFIG_PM_ENABLE
-DCONFIG_LWIP_L2_TO_L3_COPY
-DETH_SPI_SUPPORTS_NO_IRQ=1
-DCONFIG_FREERTOS_USE_TICKLESS_IDLE=1
-DCONFIG_FREERTOS_IDLE_TIME_BEFORE_SLEEP=3
-DNEOPIXEL_ESP32_RMT_DEFAULT
Expand Down
2 changes: 1 addition & 1 deletion src/_P073_7DGT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ void tm1637_i2cWrite(uint8_t clk_pin,
for (i = 0; i < 8; i++) {
CLK_LOW();

if (bytetoprint & B00000001) {
if (bytetoprint & 0b00000001) {
DIO_HIGH();
} else {
DIO_LOW();
Expand Down
Loading

0 comments on commit 87c1d6a

Please sign in to comment.