Skip to content

Commit d035116

Browse files
committed
Use new target identifier for M4
1 parent 9b0f754 commit d035116

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/Battery.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class Battery {
269269

270270
#if defined(ARDUINO_PORTENTA_C33)
271271
TwoWire *wire = &Wire3;
272-
#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
272+
#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_GENERIC_STM32H747_M4)
273273
TwoWire *wire = &Wire1;
274274
#elif defined(ARDUINO_NICLA_VISION)
275275
TwoWire *wire = &Wire1;

src/Board.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void Board::enableWakeupFromPin(uint8_t pin, PinStatus direction){
117117
}
118118
#endif
119119

120-
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_NICLA_VISION)
120+
#if defined(ARDUINO_PORTENTA_H7) || defined(ARDUINO_NICLA_VISION)
121121
void Board::enableWakeupFromPin(){
122122
standbyType |= StandbyType::untilPinActivity;
123123
}
@@ -160,7 +160,7 @@ void Board::enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t secon
160160
}
161161
#endif
162162

163-
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_NICLA_VISION)
163+
#if defined(ARDUINO_PORTENTA_H7) || defined(ARDUINO_NICLA_VISION)
164164
void Board::enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t seconds){
165165
standbyType |= StandbyType::untilTimeElapsed;
166166
wakeupDelayHours = hours;
@@ -178,7 +178,9 @@ void Board::sleepUntilWakeupEvent(){
178178
void Board::standByUntilWakeupEvent(){
179179
#if defined(ARDUINO_PORTENTA_C33)
180180
lowPower -> deepSleep();
181-
#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_NICLA_VISION)
181+
#elif defined(ARDUINO_GENERIC_STM32H747_M4)
182+
LowPower.standbyM4();
183+
#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION)
182184
RTCWakeupDelay rtcWakeupDelay = RTCWakeupDelay(wakeupDelayHours, wakeupDelayMinutes, wakeupDelaySeconds);
183185
if(standbyType == StandbyType::untilEither)
184186
LowPower.standbyM7(LowPowerStandbyType::untilPinActivity | LowPowerStandbyType::untilTimeElapsed, rtcWakeupDelay);
@@ -197,7 +199,7 @@ void Board::setAllPeripheralsPower(bool on){
197199
// I2C needs to be shut down because the PMIC would still try
198200
// to communicate with the MCU.
199201
Wire3.end();
200-
#else if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
202+
#else if defined(ARDUINO_PORTENTA_H7)
201203
// TODO Can we extract this into functions?
202204
if(on){
203205
PMIC.getControl() -> turnLDO2On(Ldo2Mode::Normal);

src/Board.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
#include <Arduino_PF1550.h>
66
#include "WireUtils.h"
77

8+
#define ARDUINO_PORTENTA_H7 defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_GENERIC_STM32H747_M4)
89

910
#if defined(ARDUINO_PORTENTA_C33)
1011
#include "Arduino_Portenta_C33_LowPower.h"
1112
#include "RTC.h"
12-
#elif defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4) || defined(ARDUINO_NICLA_VISION)
13+
#elif defined(ARDUINO_PORTENTA_H7) || defined(ARDUINO_NICLA_VISION)
1314
#include "Arduino_LowPowerPortentaH7.h"
1415
#endif
1516

@@ -92,7 +93,7 @@ class Board {
9293
void setCameraPowerEnabled(bool enabled);
9394

9495

95-
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
96+
#if defined(ARDUINO_PORTENTA_H7)
9697

9798
/**
9899
* Enables wakeup from pin GPIO0 on Portenta H7.
@@ -132,7 +133,7 @@ class Board {
132133
void enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t seconds, void (* const callbackFunction)() = nullptr, RTClock * rtc = &RTC);
133134
#endif
134135

135-
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
136+
#if defined(ARDUINO_PORTENTA_H7)
136137
void enableWakeupFromRTC(uint32_t hours, uint32_t minutes, uint32_t seconds);
137138
#endif
138139

0 commit comments

Comments
 (0)