Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1f646d2
Try NTP split update to actual source
MaxineMuster Jul 10, 2025
7e12b02
fix windows makefiles and timed_events
MaxineMuster Jul 10, 2025
5f4dfff
fix typo
MaxineMuster Jul 10, 2025
0b6c917
Fix sprintf format
MaxineMuster Jul 11, 2025
ccdcd2a
sprintf format - next try to fix for ESP and ESP8266
MaxineMuster Jul 11, 2025
021155e
sprintf - special case for ESP8266
MaxineMuster Jul 11, 2025
c488e60
Adding GUI button to set clock
MaxineMuster Jul 11, 2025
dec2b85
fix
MaxineMuster Jul 11, 2025
207d748
Add debug output
MaxineMuster Jul 11, 2025
c83f337
fix missing HTTP output
MaxineMuster Jul 11, 2025
c6bdab2
limit functions to NTP ode CLOCK present
MaxineMuster Jul 11, 2025
3ad7ddc
try fix selftests
MaxineMuster Jul 11, 2025
36cb4a1
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Jul 19, 2025
03fb760
Enable simple clock for all platforms, even if NTP is not enabled
MaxineMuster Jul 19, 2025
9aed9f6
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Aug 8, 2025
8e20944
test fixing merge-conflict
MaxineMuster Aug 14, 2025
17c4b66
Merge branch 'Split_NTP_new' of github.com:MaxineMuster/OpenBK7231T_A…
MaxineMuster Aug 14, 2025
dc11774
try fixing merge conflicts #1
MaxineMuster Aug 14, 2025
49348f4
Merge branch 'main' into Split_NTP_new
MaxineMuster Aug 14, 2025
f1480da
try fix merge conflict
MaxineMuster Aug 18, 2025
c95ffdd
Resolve merge conflicts
MaxineMuster Aug 18, 2025
4cade04
Fix typos
MaxineMuster Aug 18, 2025
fee56dc
Fix setDST argument passing
MaxineMuster Aug 18, 2025
4e155ea
only test DST if clock is running
MaxineMuster Aug 18, 2025
46ebc00
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Aug 19, 2025
c5d50a9
Fix setting epoch time - use atol(<string arg>) instead of Tokenizer_…
MaxineMuster Aug 20, 2025
a59092d
Merge branch 'Split_NTP_new' of github.com:MaxineMuster/OpenBK7231T_A…
MaxineMuster Aug 20, 2025
f614f81
Fix g_secondsElapesd for Windows - no xTicks there so stick to old wa…
MaxineMuster Aug 20, 2025
9e06c81
Fix simulator build
MaxineMuster Aug 21, 2025
f4dbf2f
Use esp_timer_get_time() instead of xTicks for ESP.
MaxineMuster Aug 22, 2025
f75aca5
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Aug 23, 2025
e877c86
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Aug 30, 2025
2dfe062
Merge remote-tracking branch 'upstream/main' into Split_NTP_new
MaxineMuster Sep 9, 2025
9dbba38
Merge branch 'Split_NTP_new' of github.com:MaxineMuster/OpenBK7231T_A…
MaxineMuster Sep 9, 2025
5ed86f0
Simple fix for TXW81X (no RTOS)
MaxineMuster Sep 10, 2025
8243c50
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Sep 15, 2025
f6af766
try fixing windows build
MaxineMuster Sep 15, 2025
b6d6764
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Sep 28, 2025
636c5c4
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Sep 29, 2025
7ddf1c2
fix define for Beken
MaxineMuster Sep 29, 2025
29689f5
fix g_secondsElapsed for RDA5981
MaxineMuster Sep 29, 2025
7ae6b5f
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Oct 1, 2025
1c184dc
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Oct 2, 2025
f111590
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Oct 5, 2025
4e52226
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Oct 6, 2025
026858b
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Oct 10, 2025
f6af552
fix sunset handling
MaxineMuster Oct 15, 2025
693fc33
Merge branch 'Split_NTP_new' of github.com:MaxineMuster/OpenBK7231T_A…
MaxineMuster Oct 15, 2025
6e12e2c
Merge branch 'openshwprojects:main' into Split_NTP_new
MaxineMuster Oct 15, 2025
8c46bb8
Merge remote-tracking branch 'upstream/main' into Split_NTP_new
MaxineMuster Oct 22, 2025
624cbc9
If we have both daylight saving time (DST) and sunset/sunrise calcula…
MaxineMuster Oct 26, 2025
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
4 changes: 3 additions & 1 deletion openBeken_win32_mvsc2017.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@
<ClCompile Include="src\driver\drv_max72xx_single.c" />
<ClCompile Include="src\driver\drv_mcp9808.c" />
<ClCompile Include="src\driver\drv_ntp.c" />
<ClCompile Include="src\driver\drv_ntp_events.c" />
<ClCompile Include="src\driver\drv_deviceclock.c" />
<ClCompile Include="src\libraries\obktime\obktime.c" />
<ClCompile Include="src\driver\drv_timed_events.c" />
<ClCompile Include="src\driver\drv_openWeatherMap.c" />
<ClCompile Include="src\driver\drv_pinMutex.c" />
<ClCompile Include="src\driver\drv_pir.c" />
Expand Down
2 changes: 1 addition & 1 deletion openBeken_win32_mvsc2017.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<ClCompile Include="src\driver\drv_max72xx_single.c" />
<ClCompile Include="src\driver\drv_mcp9808.c" />
<ClCompile Include="src\driver\drv_ntp.c" />
<ClCompile Include="src\driver\drv_ntp_events.c" />
<ClCompile Include="src\driver\drv_timed_events.c" />
<ClCompile Include="src\driver\drv_pt6523.c" />
<ClCompile Include="src\driver\drv_pwmToggler.c" />
<ClCompile Include="src\driver\drv_pwrCal.c" />
Expand Down
4 changes: 2 additions & 2 deletions platforms/BL602/bouffalo.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Component Makefile
#
## These include paths would be exported to project level
COMPONENT_ADD_INCLUDEDIRS += src/ src/httpserver/ src/httpclient/ src/cmnds/ src/logging/ src/hal/bl602/ src/mqtt/ src/cJSON src/base64 src/driver src/devicegroups src/bitmessage src/littlefs libraries/berry/src include/
COMPONENT_ADD_INCLUDEDIRS += src/ src/httpserver/ src/httpclient/ src/cmnds/ src/logging/ src/hal/bl602/ src/mqtt/ src/cJSON src/base64 src/driver src/devicegroups src/bitmessage src/littlefs libraries/berry/src src/libraries/obktime/ include/

## not be exported to project level
COMPONENT_PRIV_INCLUDEDIRS :=
Expand All @@ -15,6 +15,6 @@ COMPONENT_SRCS :=
COMPONENT_OBJS := $(patsubst %.c,%.o, $(COMPONENT_SRCS))
COMPONENT_OBJS := $(patsubst %.S,%.o, $(COMPONENT_OBJS))

COMPONENT_SRCDIRS := src/ src/jsmn src/httpserver src/httpclient src/cmnds src/logging src/hal/bl602 src/mqtt src/i2c src/cJSON src/base64 src/driver src/devicegroups src/bitmessage src/littlefs src/hal/generic libraries/berry/src src/berry src/berry/modules src/libraries/IRremoteESP8266/src
COMPONENT_SRCDIRS := src/ src/jsmn src/httpserver src/httpclient src/cmnds src/logging src/hal/bl602 src/mqtt src/i2c src/cJSON src/base64 src/driver src/devicegroups src/bitmessage src/littlefs src/hal/generic libraries/berry/src src/berry src/berry/modules src/libraries/obktime src/libraries/IRremoteESP8266/src

COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive
4 changes: 3 additions & 1 deletion platforms/obk_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ set(OBKM_SRC
${OBK_SRCS}driver/drv_max72xx_single.c
${OBK_SRCS}driver/drv_mcp9808.c
${OBK_SRCS}driver/drv_ntp.c
${OBK_SRCS}driver/drv_ntp_events.c
${OBK_SRCS}driver/drv_deviceclock.c
${OBK_SRCS}libraries/obktime/obktime.c
${OBK_SRCS}driver/drv_timed_events.c
${OBK_SRCS}driver/drv_openWeatherMap.c
${OBK_SRCS}driver/drv_pir.c
${OBK_SRCS}driver/drv_pixelAnim.c
Expand Down
4 changes: 3 additions & 1 deletion platforms/obk_main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ OBKM_SRC += $(OBK_SRCS)driver/drv_max72xx_internal.c
OBKM_SRC += $(OBK_SRCS)driver/drv_max72xx_single.c
OBKM_SRC += $(OBK_SRCS)driver/drv_mcp9808.c
OBKM_SRC += $(OBK_SRCS)driver/drv_ntp.c
OBKM_SRC += $(OBK_SRCS)driver/drv_ntp_events.c
OBKM_SRC += $(OBK_SRCS)driver/drv_deviceclock.c
OBKM_SRC += $(OBK_SRCS)libraries/obktime/obktime.c
OBKM_SRC += $(OBK_SRCS)driver/drv_timed_events.c
OBKM_SRC += $(OBK_SRCS)driver/drv_openWeatherMap.c
OBKM_SRC += $(OBK_SRCS)driver/drv_pir.c
OBKM_SRC += $(OBK_SRCS)driver/drv_pixelAnim.c
Expand Down
83 changes: 41 additions & 42 deletions src/cmnds/cmd_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "../driver/drv_public.h"
#include "../driver/drv_battery.h"
#include "../driver/drv_ntp.h"
#include "../driver/drv_deviceclock.h"
#include "../hal/hal_flashVars.h"
#include <ctype.h> // isspace

Expand Down Expand Up @@ -276,50 +277,50 @@ float getFailedBoots(const char *s) {
float getUpTime(const char *s) {
return g_secondsElapsed;
}
#if ENABLE_LOCAL_CLOCK || ENABLE_NTP
float getWeekDay(const char *s) {
return NTP_GetWeekDay();
return CLOCK_GetWeekDay();
}
float getMinute(const char *s) {
return NTP_GetMinute();
return CLOCK_GetMinute();
}
float getHour(const char *s) {
return NTP_GetHour();
return CLOCK_GetHour();
}
float getSecond(const char *s) {
return NTP_GetSecond();
return CLOCK_GetSecond();
}
float getYear(const char *s) {
return NTP_GetYear();
return CLOCK_GetYear();
}
float getMonth(const char *s) {
return NTP_GetMonth();
return CLOCK_GetMonth();
}
float getMDay(const char *s) {
return NTP_GetMDay();
return CLOCK_GetMDay();
}

#endif
#ifdef ENABLE_NTP

float getNTPOn(const char* s)
{
float getNTPOn(const char *s) {
return NTP_IsTimeSynced();
}

#endif
#if ENABLE_CLOCK_DST

#if ENABLE_NTP_DST
float isDST(const char *s){
return Time_IsDST();
}
#endif

#if ENABLE_NTP_SUNRISE_SUNSET
#if ENABLE_CLOCK_SUNRISE_SUNSET


float getSunrise(const char *s) {
return NTP_GetSunrise();
return CLOCK_GetSunrise();
}
float getSunset(const char *s) {
return NTP_GetSunset();
return CLOCK_GetSunset();
}

#endif
Expand Down Expand Up @@ -444,71 +445,69 @@ const constant_t g_constants[] = {
//cnstdetail:"descr":"Current value of energy counter from energy metering chip",
//cnstdetail:"requires":""}
{"$energy", &getEnergy},
//cnstdetail:{"name":"$yesterday",
//cnstdetail:"title":"$yesterday",
//cnstdetail:"descr":"Yesterdays energy consuption",
//cnstdetail:"requires":""}
{ "$yesterday", &getYesterday },
//cnstdetail:{"name":"$today",
//cnstdetail:"title":"$today",
//cnstdetail:"descr":"Todays energy consuption",
//cnstdetail:"requires":""}
{ "$today", &getToday },
#endif //ENABLE_DRIVER_BL0937
#if ENABLE_LOCAL_CLOCK || ENABLE_NTP
//cnstdetail:{"name":"$day",
//cnstdetail:"title":"$day",
//cnstdetail:"descr":"Current weekday from NTP",
//cnstdetail:"descr":"Current weekday from device clock",
//cnstdetail:"requires":""}
#endif //ENABLE_DRIVER_BL0937
#ifdef ENABLE_NTP
{"$day", &getWeekDay},
//cnstdetail:{"name":"$hour",
//cnstdetail:"title":"$hour",
//cnstdetail:"descr":"Current hour from NTP",
//cnstdetail:"descr":"Current hour from device clock",
//cnstdetail:"requires":""}
{"$hour", &getHour},
//cnstdetail:{"name":"$minute",
//cnstdetail:"title":"$minute",
//cnstdetail:"descr":"Current minute from NTP",
//cnstdetail:"descr":"Current minute from device clock",
//cnstdetail:"requires":""}
{ "$minute", &getMinute },
//cnstdetail:{"name":"$second",
//cnstdetail:"title":"$second",
//cnstdetail:"descr":"Current second from NTP",
//cnstdetail:"descr":"Current second from device clock",
//cnstdetail:"requires":""}
{ "$second", &getSecond },
//cnstdetail:{"name":"$mday",
//cnstdetail:"title":"$mday",
//cnstdetail:"descr":"Current mday from NTP",
//cnstdetail:"descr":"Current mday from device clock",
//cnstdetail:"requires":""}
{ "$mday", &getMDay },
//cnstdetail:{"name":"$month",
//cnstdetail:"title":"$month",
//cnstdetail:"descr":"Current month from NTP",
//cnstdetail:"descr":"Current month from device clock",
//cnstdetail:"requires":""}
{ "$month", &getMonth },
//cnstdetail:{"name":"$year",
//cnstdetail:"title":"$year",
//cnstdetail:"descr":"Current Year from NTP",
//cnstdetail:"descr":"Current Year from device clock",
//cnstdetail:"requires":""}
{ "$year", &getYear },
#ifdef ENABLE_DRIVER_BL0937
//cnstdetail:{"name":"$yesterday",
//cnstdetail:"title":"$yesterday",
//cnstdetail:"descr":"",
//cnstdetail:"requires":""}
{ "$yesterday", &getYesterday },
//cnstdetail:{"name":"$today",
//cnstdetail:"title":"$today",
//cnstdetail:"descr":"",
//cnstdetail:"requires":""}
{ "$today", &getToday },
#endif
#if ENABLE_NTP_DST
#if ENABLE_CLOCK_DST
//cnstdetail:{"name":"$isDST",
//cnstdetail:"title":"$isDST",
//cnstdetail:"descr":"",
//cnstdetail:"descr":"Returns 1 if DST (daylight saving time) is active, otherwise 0",
//cnstdetail:"requires":""}
{ "$isDST", &isDST },
#endif
#if ENABLE_NTP_SUNRISE_SUNSET
#if ENABLE_CLOCK_SUNRISE_SUNSET
//cnstdetail:{"name":"$sunrise",
//cnstdetail:"title":"$sunrise",
//cnstdetail:"descr":"Next sunrise as a TimerSeconds from midnight",
//cnstdetail:"descr":"Next sunrise as a TimerSeconds from midnight - will also print time to log",
//cnstdetail:"requires":""}
{ "$sunrise", &getSunrise },
//cnstdetail:{"name":"$sunset",
//cnstdetail:"title":"$sunset",
//cnstdetail:"descr":"Next sunset as a TimerSeconds from midnight",
//cnstdetail:"descr":"Next sunset as a TimerSeconds from midnight - will also print time to log",
//cnstdetail:"requires":""}
{ "$sunset", &getSunset },
#endif
Expand All @@ -517,7 +516,7 @@ const constant_t g_constants[] = {
//cnstdetail:"descr":"Returns 1 if NTP is on and already synced (so device has correct time), otherwise 0.",
//cnstdetail:"requires":""}
{ "$NTPOn", &getNTPOn },
#endif //ENABLE_NTP
#endif // ENABLE_LOCAL_CLOCK || ENABLE_NTP
#ifdef ENABLE_DRIVER_BATTERY
//cnstdetail:{"name":"$batteryVoltage",
//cnstdetail:"title":"$batteryVoltage",
Expand Down
Loading