Skip to content

Commit eee42c5

Browse files
authored
Merge pull request #1569 from IoTThinks/MCdev-Fixed-Incorrect-Release-of-RefCountedDigitalPin
Fixed RefCountedDigitalPin.h and SSD1306Display for Heltec v4
2 parents b67decf + 13d0dff commit eee42c5

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/helpers/RefCountedDigitalPin.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ class RefCountedDigitalPin {
2020
digitalWrite(_pin, _active);
2121
}
2222
}
23+
2324
void release() {
25+
if (_claims == 0) return; // avoid negative _claims
26+
2427
_claims--;
2528
if (_claims == 0) {
2629
digitalWrite(_pin, !_active);

variants/heltec_v4/platformio.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ build_flags =
2222
-D P_LORA_PA_TX_EN=46 ; PA CPS - GC1109 TX PA full(High) / bypass(Low)
2323
-D PIN_USER_BTN=0
2424
-D PIN_VEXT_EN=36
25-
-D PIN_VEXT_EN_ACTIVE=LOW
25+
-D PIN_VEXT_EN_ACTIVE=HIGH
2626
-D LORA_TX_POWER=10 ;If it is configured as 10 here, the final output will be 22 dbm.
2727
-D MAX_LORA_TX_POWER=22 ; Max SX1262 output
2828
-D SX126X_REGISTER_PATCH=1 ; Patch register 0x8B5 for improved RX
@@ -54,8 +54,6 @@ build_flags =
5454
-D PIN_BOARD_SDA=17
5555
-D PIN_BOARD_SCL=18
5656
-D PIN_OLED_RESET=21
57-
-D ENV_PIN_SDA=4
58-
-D ENV_PIN_SCL=3
5957
build_src_filter= ${Heltec_lora32_v4.build_src_filter}
6058
lib_deps = ${Heltec_lora32_v4.lib_deps}
6159

variants/heltec_v4/target.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ AutoDiscoverRTCClock rtc_clock(fallback_clock);
2424
#endif
2525

2626
#ifdef DISPLAY_CLASS
27-
DISPLAY_CLASS display(&(board.periph_power));
27+
DISPLAY_CLASS display(NULL);
2828
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
2929
#endif
3030

0 commit comments

Comments
 (0)