Skip to content

Commit d179370

Browse files
committedAug 4, 2024·
chore: rename variable
1 parent 323ec59 commit d179370

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed
 

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ Copy `config_example.h` to `config.h` and add/change your settings.
5151

5252
##### Variable sleep intervals
5353

54-
If you want your inkplate to sleep with different intervals, copy `config_example.cpp` to `config.cpp` and uncomment the 3 lines in `config.h` starting from `#include "sleep_duration.h"`. Then configure your sleepTimeBlocks.
54+
If you want your inkplate to sleep with different intervals, copy `config_example.cpp` to `config.cpp` and uncomment the 3 lines in `config.h` starting from `#include "sleep_duration.h"`. Then configure your `sleepSchedule`.
5555

56-
Note that time blocks do not span multiple days, this means that the *day of week* setting is similar to configuring a cronjob. F.e. the settings below should be read as *between Xam to Ypm on every weekday*, and **not** as *from monday Xam to friday Ypm*.
56+
Note that schedule slots do not span multiple days, this means that the *day of week* setting is similar to configuring a cronjob. F.e. the settings below should be read as *between Xam to Ypm on every weekday*, and **not** as *from monday Xam to friday Ypm*.
5757

5858
```cpp
5959
{

‎lib/libhomeplate/src/sleep_duration.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "sleep_duration.h"
22

3-
uint getSleepDuration(SleepScheduleSlot sleepScheduleSlots[], size_t size, TimeInfo time, SleepDefaults defaults, bool doQuickSleep)
3+
uint getSleepDuration(SleepScheduleSlot sleepSchedule[], size_t size, TimeInfo time, SleepDefaults defaults, bool doQuickSleep)
44
{
55
if (doQuickSleep) {
66
return defaults.quickSleep;
@@ -9,7 +9,7 @@ uint getSleepDuration(SleepScheduleSlot sleepScheduleSlots[], size_t size, TimeI
99
uint timeInMinutes = time.hour * 60 + time.minute;
1010

1111
for (int i = 0; i < size; i++) {
12-
SleepScheduleSlot b = sleepScheduleSlots[i];
12+
SleepScheduleSlot b = sleepSchedule[i];
1313

1414
if (time.dow >= b.start_dow && time.dow <= b.end_dow) {
1515
uint startTimeInMinutes = b.start_hour * 60 + b.start_minute;

‎lib/libhomeplate/src/sleep_duration.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ struct SleepDefaults {
2323
uint quickSleep;
2424
};
2525

26-
uint getSleepDuration(SleepScheduleSlot sleepScheduleSlots[], size_t size, TimeInfo time, SleepDefaults sleep, bool doQuickSleep = false);
26+
uint getSleepDuration(SleepScheduleSlot sleepSchedule[], size_t size, TimeInfo time, SleepDefaults sleep, bool doQuickSleep = false);
2727

2828
#endif

‎src/activity.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void runActivities(void *params)
8181

8282
Serial.printf("[ACTIVITY] starting activity: %d\n", activityNext);
8383
bool doQuickSleep = activityNext == GuestWifi || activityNext == Info;
84-
#ifdef sleepScheduleSlots
84+
#ifdef sleepSchedule
8585
TimeInfo time = {
8686
.dow = getDayOfWeek(true),
8787
.hour = getHour(),
@@ -91,7 +91,7 @@ void runActivities(void *params)
9191
.normalSleep = TIME_TO_SLEEP_SEC,
9292
.quickSleep = TIME_TO_QUICK_SLEEP_SEC,
9393
};
94-
uint timeToSleep = getSleepDuration(sleepScheduleSlots, sleepScheduleSlotCount, time, defaults, doQuickSleep);
94+
uint timeToSleep = getSleepDuration(sleepSchedule, sleepScheduleSize, time, defaults, doQuickSleep);
9595
#else
9696
uint timeToSleep = doQuickSleep ? TIME_TO_QUICK_SLEEP_SEC : TIME_TO_SLEEP_SEC;
9797
#endif

‎src/config_example.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// - there is no validation of any kind, make sure your blocks are continuous
88
// - time blocks should be configured per day
99
// - dow = DayOfWeek, starts at 1 = Monday to 7 = Sunday
10-
// SleepScheduleSlot sleepScheduleSlots[] = {
10+
// SleepScheduleSlot sleepSchedule[] = {
1111
/* EXAMPLE BLOCKS
1212
{ // On each workday from 00:00 to 08:30 sleep for 1 hour
1313
.start_dow = 1,
@@ -57,4 +57,4 @@
5757
*/
5858
// };
5959

60-
//const size_t sleepScheduleSlotCount = sizeof(sleepScheduleSlots) / sizeof(sleepScheduleSlots[0]);
60+
//const size_t sleepScheduleSize = sizeof(sleepSchedule) / sizeof(sleepSchedule[0]);

‎src/config_example.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
// Configure sleep times for different time blocks
2020
// NOTE: configure the actual sleep schedule in config.cpp, see config_example.cpp
2121
//#include "sleep_schedule.h"
22-
//extern SleepScheduleSlot sleepScheduleSlots[];
23-
//extern const size_t sleepScheduleSlotCount;
22+
//extern SleepScheduleSlot sleepSchedule[];
23+
//extern const size_t sleepScheduleSize;
2424

2525
// Static IP information
2626
// If unset uses DHCP, but updates may be slower, set to use a Static IP

0 commit comments

Comments
 (0)
Please sign in to comment.