From b974351c6a1eae4a1bd14fea53d95e6ffb35c6ec Mon Sep 17 00:00:00 2001 From: cam Date: Fri, 15 Sep 2023 17:41:20 +1200 Subject: [PATCH] Power on RP2040 --- src/Pinout.h | 1 + src/main.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/Pinout.h b/src/Pinout.h index 5c628d9..5782fce 100644 --- a/src/Pinout.h +++ b/src/Pinout.h @@ -12,5 +12,6 @@ #define BUTTON PIN_PA6 // Connected to the button on the case. #define PING_PIN PIN_PB2 #define PI_SHUTDOWN PIN_PA7 // Raspberry Pi will drive this pin low when it has finished powering off. +#define EN_RP2040 PIN_PA1 // Drive low to power on rp2040. #endif \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 65dc35f..0b06e1f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -97,6 +97,7 @@ void setup() { pinMode(LED_B, OUTPUT); pinMode(EN_5V, OUTPUT); digitalWrite(EN_5V, HIGH); + pinMode(EN_RP2040, OUTPUT); pinMode(RTC_BAT_SENSE, INPUT); pinMode(MAIN_BAT_SENSE, INPUT); pinMode(RTC_ALARM, INPUT_PULLUP); @@ -104,6 +105,8 @@ void setup() { pinMode(PI_SHUTDOWN, INPUT_PULLUP); statusLED.writeColor(0, 0, 0); + digitalWrite(EN_RP2040, LOW); + // Check for a low battery. checkMainBattery();