cpu/sam*: pm: make use of DEBUG_PUTS()
`pm_set()` gets called by the idle thread whose stack is too small for normal DEBUG()/printf(). Use DEBUG_PUTS() instead to print the static debug strings.
This commit is contained in:
parent
3eae474e74
commit
9df377d699
@ -22,12 +22,7 @@
|
||||
#include "periph/pm.h"
|
||||
|
||||
#define ENABLE_DEBUG (0)
|
||||
|
||||
#if ENABLE_DEBUG
|
||||
#define DEBUG(s) puts(s)
|
||||
#else
|
||||
#define DEBUG(s)
|
||||
#endif
|
||||
#include "debug.h"
|
||||
|
||||
void pm_set(unsigned mode)
|
||||
{
|
||||
@ -36,23 +31,23 @@ void pm_set(unsigned mode)
|
||||
|
||||
switch (mode) {
|
||||
case 0:
|
||||
DEBUG("pm_set(): setting BACKUP mode.");
|
||||
DEBUG_PUTS("pm_set(): setting BACKUP mode.");
|
||||
_mode = PM_SLEEPCFG_SLEEPMODE_BACKUP;
|
||||
deep = 1;
|
||||
break;
|
||||
case 1:
|
||||
DEBUG("pm_set(): setting HIBERNATE mode.");
|
||||
DEBUG_PUTS("pm_set(): setting HIBERNATE mode.");
|
||||
_mode = PM_SLEEPCFG_SLEEPMODE_HIBERNATE;
|
||||
deep = 1;
|
||||
break;
|
||||
case 2:
|
||||
DEBUG("pm_set(): setting STANDBY mode.");
|
||||
DEBUG_PUTS("pm_set(): setting STANDBY mode.");
|
||||
_mode = PM_SLEEPCFG_SLEEPMODE_STANDBY;
|
||||
deep = 1;
|
||||
break;
|
||||
default: /* Falls through */
|
||||
case 3:
|
||||
DEBUG("pm_set(): setting IDLE2 mode.");
|
||||
DEBUG_PUTS("pm_set(): setting IDLE2 mode.");
|
||||
_mode = PM_SLEEPCFG_SLEEPMODE_IDLE2;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -31,12 +31,12 @@ void pm_set(unsigned mode)
|
||||
|
||||
switch (mode) {
|
||||
case 0:
|
||||
DEBUG("pm_set(): setting STANDBY mode.\n");
|
||||
DEBUG_PUTS("pm_set(): setting STANDBY mode.");
|
||||
_mode = PM_SLEEPCFG_SLEEPMODE_STANDBY;
|
||||
break;
|
||||
default: /* Falls through */
|
||||
case 1:
|
||||
DEBUG("pm_set(): setting IDLE mode.\n");
|
||||
DEBUG_PUTS("pm_set(): setting IDLE mode.");
|
||||
_mode = PM_SLEEPCFG_SLEEPMODE_IDLE;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -31,16 +31,16 @@ void pm_set(unsigned mode)
|
||||
|
||||
switch (mode) {
|
||||
case 0:
|
||||
DEBUG("pm_set(): setting BACKUP mode.\n");
|
||||
DEBUG_PUTS("pm_set(): setting BACKUP mode.");
|
||||
_mode = PM_SLEEPCFG_SLEEPMODE_BACKUP;
|
||||
break;
|
||||
case 1:
|
||||
DEBUG("pm_set(): setting STANDBY mode.\n");
|
||||
DEBUG_PUTS("pm_set(): setting STANDBY mode.");
|
||||
_mode = PM_SLEEPCFG_SLEEPMODE_STANDBY;
|
||||
break;
|
||||
default: /* Falls through */
|
||||
case 2:
|
||||
DEBUG("pm_set(): setting IDLE mode.\n");
|
||||
DEBUG_PUTS("pm_set(): setting IDLE mode.");
|
||||
#if defined(CPU_MODEL_SAMR30G18A) || defined(CPU_MODEL_SAMR34J18B)
|
||||
_mode = PM_SLEEPCFG_SLEEPMODE_IDLE;
|
||||
#else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user