Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions components/kaos/core/src/kset.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
#define KSET_SLEEP_AFTER_SECS { 30U, KSET_S_MIN, 2U * KSET_S_MIN, \
5U * KSET_S_MIN, 10U * KSET_S_MIN, KSET_S_NEVER }
/** The times asleep `off_after` offers. */
#define KSET_OFF_AFTER_WORDS { "1h", "6h", "24h", "3d", "7d", "never" }
/** The seconds of each, 1 h being KODE_LOWPOWER_OFF_AFTER_DEF_S. */
#define KSET_OFF_AFTER_SECS { KSET_S_HOUR, 6U * KSET_S_HOUR, KSET_S_DAY, \
3U * KSET_S_DAY, 7U * KSET_S_DAY, KSET_S_NEVER }
#define KSET_OFF_AFTER_WORDS { "20m", "1h", "6h", "24h", "7d", "never" }
/** The seconds of each, 20 min being KODE_LOWPOWER_OFF_AFTER_DEF_S. */
#define KSET_OFF_AFTER_SECS { 20U * KSET_S_MIN, KSET_S_HOUR, 6U * KSET_S_HOUR, \
KSET_S_DAY, 7U * KSET_S_DAY, KSET_S_NEVER }

/** The ages `chan_keep` offers. */
#define KSET_CHAN_KEEP_WORDS { "1h", "6h", "1d", "3d", "7d", "never" }
Expand Down
2 changes: 1 addition & 1 deletion components/kqp/include/kqp_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
#define KODE_LOWPOWER_QUEUE_LEN 48U /**< AO_LowPower's queue: every participant's answer, a request and the inputs. */
#define KODE_LOWPOWER_RADIO_MAX_MS 60000U /**< Longest a radio wake lasts before the radio owners are asked to rest, done or not. */
#define KODE_LOWPOWER_SLEEP_AFTER_DEF_S 120U /**< Idle time before ASLEEP: 2 min. */
#define KODE_LOWPOWER_OFF_AFTER_DEF_S 3600U /**< Asleep time before OFF: 1 h. */
#define KODE_LOWPOWER_OFF_AFTER_DEF_S 1200U /**< Asleep time before OFF: 20 min. */
#define KODE_LOWPOWER_DIM_PCT 20U /**< The glass in ASLEEP when no glyphs were handed;
* the interface sets its own through rest_pct. */
#define KODE_LOWPOWER_MINUTE_S 60U /**< The minute the glass is lit for. */
Expand Down
9 changes: 5 additions & 4 deletions tests/host/cases/test_lowpower_ao.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

/** @brief `sleep_after` / `off_after` word indexes the cases use. */
#define WORD_30S 0U /**< sleep_after: "30s". */
#define WORD_1H 0U /**< off_after: "1h". */
#define WORD_1H 1U /**< off_after: "1h". */
#define WORD_NEVER 5U /**< Either: "never". */

/** @brief The default idle time, milliseconds. */
Expand Down Expand Up @@ -1494,15 +1494,16 @@ TEST_CASE("sleep_after: default, set, stored and read back after a restart", "[l

TEST_CASE("off_after: default, every word, never", "[lowpower_ao]")
{
static const char * const words[] = { "1h", "6h", "24h", "3d", "7d", "never" };
static const char * const words[] = { "20m", "1h", "6h", "24h", "7d", "never" };
const KodeConfigAnsEvt *a;

lp_up(KODE_OK);

a = config_ask(AO_LowPower, &(config_ask_t){ .key = KSET_KEY_OFF_AFTER });
TEST_ASSERT_NOT_NULL(a);
TEST_ASSERT_EQUAL_STRING("1h", a->value);
TEST_ASSERT_EQUAL_STRING("20m", a->value);
TEST_ASSERT_FALSE(a->stored);
TEST_ASSERT_EQUAL_UINT32(20U * 60U, KODE_LOWPOWER_OFF_AFTER_DEF_S);

for ( uint8_t i = 0U; Q_DIM(words) > i; i++ )
{
Expand All @@ -1528,7 +1529,7 @@ TEST_CASE("a stored value this build does not list reads as the default, not sto

a = config_ask(AO_LowPower, &(config_ask_t){ .key = KSET_KEY_OFF_AFTER });
TEST_ASSERT_NOT_NULL(a);
TEST_ASSERT_EQUAL_STRING("1h", a->value);
TEST_ASSERT_EQUAL_STRING("20m", a->value);
TEST_ASSERT_FALSE(a->stored);
a = config_ask(AO_LowPower, &(config_ask_t){ .key = KSET_KEY_SLEEP_AFTER });
TEST_ASSERT_NOT_NULL(a);
Expand Down
Loading