Skip to content

Commit

Permalink
fix: wrong pin mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaven Arra committed Jul 11, 2024
1 parent d03e897 commit c9aa104
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/datalogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,11 @@ void Datalogger::powerUpSwitchableComponents()
delay(250);
enableI2C1();
enableI2C2();

debug("turn on exADC");
pinMode(ENABLE_EXADC, OUTPUT_OPEN_DRAIN);
digitalWrite(ENABLE_EXADC, HIGH);
delay(500);

debug("reset exADC");
// Reset external ADC (if it's installed)
Expand Down
4 changes: 2 additions & 2 deletions src/system/hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ void setupHardwarePins()
//pinMode(PA2, OUTPUT); // USART2_TX/ADC12_IN2/TIM2_CH3
//pinMode(PA3, INPUT); // USART2_RX/ADC12_IN3/TIM2_CH4

pinMode(PC5, OUTPUT); // external ADC reset
digitalWrite(PC5, HIGH);
pinMode(EXADC_RESET, OUTPUT); // external ADC reset
digitalWrite(EXADC_RESET, HIGH);
}

int getBatteryValue()
Expand Down
6 changes: 3 additions & 3 deletions src/system/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// extern TwoWire WireTwo;
#define WireTwo Wire1

#define SWITCHED_POWER_ENABLE PC6
#define SWITCHED_POWER_ENABLE PC5
#define SD_ENABLE_PIN PC8

#define BLE_COMMAND_MODE_PIN PB5
Expand Down Expand Up @@ -75,8 +75,8 @@
//A2-A6 work as GPIO, currently used



#define EXADC_RESET PC5
#define ENABLE_EXADC PC6
#define EXADC_RESET PA4

// Bluefruit on SPI
#define BLUEFRUIT_SPI_SCK PB13
Expand Down
6 changes: 3 additions & 3 deletions src/system/low_power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ void hardwarePinsAlwaysOff() // not currently used
pinMode(PB15, INPUT);

pinMode(PC4, INPUT);
// pinMode(PC5, INPUT); // external ADC reset
// pinMode(PC6, INPUT); // this is the switch power pin
// pinMode(PC5, INPUT); // external ADC reset WRONG
// pinMode(PC6, INPUT); // this is the switch power pin WRONG

pinMode(PC9, INPUT);
pinMode(PC10, INPUT);
Expand Down Expand Up @@ -342,7 +342,7 @@ void restorePinDefaults()
pinMode(PC2, OUTPUT); // ADC12_IN12
pinMode(PC3, OUTPUT); // ADC12_IN13
pinMode(PC4, OUTPUT); // ADC12_IN14
pinMode(PC5, OUTPUT); // External ADC Reset (ADC_RESET_PC5)
pinMode(PC5, OUTPUT); // External ADC Reset (ADC_RESET_PC5) WRONG
pinMode(PC6, OUTPUT);
pinMode(PC7, OUTPUT);
pinMode(PC8, OUTPUT);
Expand Down

0 comments on commit c9aa104

Please sign in to comment.