Skip to content

STM32 SleepMethod #178

Answered by arkhipenko
dani68k asked this question in Q&A
Dec 7, 2023 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

Hi @dani68k
You do not need to modify TaskSchedulerSleepMethods.h

here is a quick way how I did it. You should be able to do the same.

void setupTS() {
  Log.trace("setupTS()" CR);

  ts.setSleepMethod( &nrf52sleep );
  enableSleep();
}

void enableSleep() {
  Log.trace("enableSleep()" CR);
  
  ts.allowSleep(true);
}

void nrf52sleep( unsigned long aDuration ) {
   // Log.trace("nrf52sleep()" CR);

  // there was some other processing here
 
  sleep();   // this is what puts chip to sleep - your implementation
}

STM32 sleep (or rather many quick naps) is already implemented. but it seems you want a longer sleep method than wfi

#elif defined( ARDUINO_ARCH_STM32F1 )

#include <libmaple/pw…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@dani68k
Comment options

@arkhipenko
Comment options

@dani68k
Comment options

Answer selected by arkhipenko
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants