-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactoring complete, first hsm, input broken
- Loading branch information
1 parent
57bcd26
commit c2e1c93
Showing
34 changed files
with
921 additions
and
1,179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
APPLICATION = teamagotchi | ||
BOARD = feather-nrf52840-sense | ||
|
||
# This has to be the absolute path to the RIOT base directory: | ||
RIOTBASE ?= $(CURDIR)/RIOT | ||
|
||
# Comment this out to disable code in RIOT that does safety checking | ||
# which is not needed in a production environment but helps in the | ||
# development process: | ||
DEVELHELP ?= 1 | ||
|
||
FEATURES_REQUIRED += cpp | ||
FEATURES_REQUIRED += libstdcpp | ||
|
||
# Internal Modules | ||
# Teamagotchi MODULES | ||
#USEMODULE += lwm2m_handler | ||
USEMODULE += io_handler | ||
USEMODULE += display_handler | ||
EXTERNAL_MODULE_DIRS += modules | ||
|
||
# External modules | ||
USEMODULE += cpp11-compat | ||
USEMODULE += ztimer | ||
USEMODULE += ztimer_msec | ||
USEMODULE += shell | ||
USEMODULE += xtimer | ||
|
||
# As there is an 'Kconfig' we want to explicitly disable Kconfig by setting | ||
# the variable to empty | ||
#SHOULD_RUN_KCONFIG ?= | ||
|
||
# Include "inc" directory for the header files | ||
INCLUDES += -I$(CURDIR)/inc | ||
|
||
# Set the C standard to C17 [C23 (even experimental) is not yet supported] | ||
# and enable all warnings | ||
CFLAGS += -std=c17 -Wall -Wextra | ||
|
||
# Set the C++ standard to C++20 [C++23 with all the cool stuff is not yet supported] | ||
# and enable all warnings | ||
CXXEXFLAGS += -std=c++20 -Wall -Wextra | ||
|
||
# Disable volatile warnings | ||
# C++20 introduced a deprecation for this, which was then | ||
# reverted in C++23 because it wasn't thought through | ||
CXXEXFLAGS += -Wno-volatile | ||
|
||
|
||
#include $(CURDIR)/modules/lwm2m/Makefile.include | ||
include $(RIOTBASE)/Makefile.include | ||
|
||
|
||
BOARD_BLACKLIST += native64 | ||
|
||
## DEBUG | ||
CFLAGS += -DDEBUG_ASSERT_VERBOSE | ||
|
||
##### LWM2M ##### | ||
#SERVER_URI = '"coap://[2001:db8:1::1]:5684"' | ||
LWM2M_SERVER_SHORT_ID ?= 1 | ||
CFLAGS += -DEVENT_THREAD_MEDIUM_STACKSIZE='(3*1024)' | ||
# Uncomment to enable Wakaama debug log | ||
#CFLAGS += -DCONFIG_LWM2M_WITH_LOGS=1 | ||
# Specific the server URI address (NOTE: Domain names not supported yet) | ||
LWM2M_SERVER_URI ?= '"coap://[fd00:dead:beef::1]:5683"' | ||
# Configure via CFLAGS only if not done via Kconfig | ||
ifndef CONFIG_LWM2M_SERVER_URI | ||
CFLAGS += -DCONFIG_LWM2M_SERVER_URI=$(LWM2M_SERVER_URI) | ||
CFLAGS += -DCONFIG_LWM2M_SERVER_SHORT_ID=$(LWM2M_SERVER_SHORT_ID) | ||
CFLAGS += -DCONFIG_DTLS_PEER_MAX=2 | ||
CFLAGS += -DCONFIG_MAX_BUF=1024 | ||
# Uncomment to enable Wakaama debug log | ||
CFLAGS += -DCONFIG_LWM2M_WITH_LOGS=1 | ||
endif | ||
##### /LWM2M ##### | ||
|
||
|
||
# SDL requires more stack | ||
ifneq (,$(filter native native64,$(BOARD))) | ||
CFLAGS += -DTHREAD_STACKSIZE_MAIN=64*1024 | ||
else ifneq (,$(filter esp%,$(CPU_FAM))) | ||
CFLAGS += -DTHREAD_STACKSIZE_MAIN=4*1024 | ||
else | ||
CFLAGS += -DTHREAD_STACKSIZE_MAIN=2*1024 | ||
endif | ||
|
||
|
||
# Note that this will probably only work for me <3 | ||
windows: all | ||
@echo "Creating UF2" | ||
@python RIOT/dist/tools/uf2/uf2conv.py -f 0xADA52840 bin/feather-nrf52840-sense/teamagotchi.hex --base 0x1000 -c | ||
@echo "Flashing UF2 via Windows (Make sure your device is actually at D)" | ||
@powershell.exe -command "cp ./flash.uf2 d:/flash.uf2" | ||
@echo "Connecting COM via USBIPD (Make sure you have the USBIPD installed + your device bound to the WSL)" | ||
@sleep 3 | ||
@usbipd.exe attach --wsl -i 1209:7d00 | ||
@sleep 3 | ||
@echo "Connected :D" | ||
@echo "Cleaning up uf2 flash file" | ||
@rm flash.uf2 | ||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "events.h" | ||
#include "event.h" | ||
|
||
static event_queue_t queues[2]; | ||
static event_handler_t handler_fn; | ||
|
||
event_queue_t * get_queue_standard(void){ | ||
return &queues[1]; | ||
// return &queues[1]; | ||
} | ||
|
||
void trigger_event_input(EVENT_T event){ | ||
team_event_t t_event = {.super.handler = handler_fn, .event = event}; | ||
event_post(&queues[0],&t_event.super); | ||
} | ||
|
||
|
||
void trigger_event(EVENT_T event){ | ||
team_event_t t_event = {.super.handler = handler_fn, .event = event}; | ||
event_post(&queues[1],&t_event.super); | ||
} | ||
|
||
|
||
void events_handler_init(event_handler_t handlerfn){ | ||
handler_fn = handlerfn; | ||
event_queues_init(queues,2); | ||
} | ||
|
||
|
||
void events_start(void){ | ||
event_loop_multi(queues,2); | ||
} |
Oops, something went wrong.