Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit 7a2cfcc

Browse files
DHJeffsergiotomasello
authored andcommitted
Added bat statement of pinMode
1 parent 4d27543 commit 7a2cfcc

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

cores/arduino/wiring_digital.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,16 @@ void pinMode( uint32_t ulPin, uint32_t ulMode )
240240
return ;
241241
}
242242

243+
if ( (ulPin == 43) && (ulMode == INPUT) )
244+
{
245+
delay(15);
246+
TwoWire_begin();
247+
TwoWire_beginTransmission(0x48);
248+
TwoWire_write(BAT_VOLT_IN);
249+
TwoWire_endTransmission();
250+
return ;
251+
}
252+
243253
if ( g_APinDescription[ulPin].ulPinType == PIO_NOT_A_PIN )
244254
{
245255
return ;

variants/arduino_primo/variant.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static const uint8_t GPIO_ESP_PW_H = 0b11101000;
9898
static const uint8_t GPIO_ESP_PW_L = 0b11101001;
9999
static const uint8_t GPIO_ESP_EN_H = 0b11101010;
100100
static const uint8_t GPIO_ESP_EN_L = 0b11101011;
101-
static const uint8_t BAT_VOL_IN = 0b11101100;
101+
static const uint8_t BAT_VOLT_IN = 0b11101100;
102102
static const uint8_t USER2_BUTTON_IN = 0b11101110;
103103
static const uint8_t GPIO_USER1_IT = 0b11111000;
104104

0 commit comments

Comments
 (0)