From b59b7090c71d654469b116166ed88ca1f33cd78b Mon Sep 17 00:00:00 2001 From: Sebastian Romero Date: Tue, 7 May 2024 15:37:36 +0200 Subject: [PATCH] Make library compile on H7 --- src/Board.cpp | 2 ++ src/Board.h | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Board.cpp b/src/Board.cpp index a076093..b8a54f9 100644 --- a/src/Board.cpp +++ b/src/Board.cpp @@ -248,6 +248,7 @@ void Board::setAllPeripheralsPower(bool on){ #endif } +#if defined(ARDUINO_PORTENTA_C33) void Board::setAnalogDigitalConverterPower(bool on){ if(on){ PMIC.getControl()->turnLDO1On(Ldo1Mode::Normal); @@ -259,6 +260,7 @@ void Board::setAnalogDigitalConverterPower(bool on){ PMIC.getControl()->turnLDO1Off(Ldo1Mode::Standby); } } +#endif void Board::setCommunicationPeripheralsPower(bool on){ if(on) diff --git a/src/Board.h b/src/Board.h index 7964710..3a7b9b8 100644 --- a/src/Board.h +++ b/src/Board.h @@ -3,7 +3,7 @@ #include #include -#include "wireUtils.h" +#include "WireUtils.h" #if defined(ARDUINO_PORTENTA_C33) @@ -199,25 +199,27 @@ class Board { */ void deepSleepUntilWakeupEvent(); - #if defined(ARDUINO_PORTENTA_C33) /** * @brief Toggle the peripherals' power on Portenta C33 (ADC, RGB LED, Secure Element, Wifi and Bluetooth). * @param on True to turn on the power, false to turn it off. */ void setAllPeripheralsPower(bool on); + /** * @brief Toggles the communication peripherials' power on Portenta C33 (Wifi, Bluetooth and Secure Element) * @param on True to turn on the power, false to turn it off. */ void setCommunicationPeripheralsPower(bool on); + #if defined(ARDUINO_PORTENTA_C33) /** * @brief Toggles the power of the analog digital converter on Portenta C33. * @param on True to turn on the power, false to turn it off. */ void setAnalogDigitalConverterPower(bool on); + #endif /** * @brief Set the reference voltage on Portenta C33. This value is used by the ADC to convert analog values to digital values. * This can be particularly useful to increase the accuracy of the ADC when working with low voltages @@ -226,7 +228,8 @@ class Board { * @return True if the voltage was set successfully, false otherwise. */ bool setReferenceVoltage(float voltage); - #endif + + // TODO add function to shut down the fuel gauge / and hibernate mode private: static uint8_t getRailVoltage(float voltage, int context);