disPOD consists of several modules:
void app_main()
does adjustment of log level, initialization of NVS Flash, SPIFFS file system, disPOD overall initialization (event groups:dispod_event_groups
,dispod_display_evg
, queue:running_values_queue
) and runs the different tasks (dispod_collector_task
,dispod_update_task
,dispod_screen_task
,dispod_archiver_task
)run_on_event
is the overall program logic- At the end of
app_main()
the event to startup disPOD (DISPOD_STARTUP_EVT
) is put in the loop.
- handles all the BLE process from scanning for devices, connecting, register notification and receiving/forwarding notifications.
- by calling
dispod_wifi_network_up()
the connection to WiFi is made, using the predefined SSID/PWD combinations. Also, an event handler is registered for the internal WiFi connection process and update of the disPOD WiFi status.
- When WiFi is available, a call to
dispod_sntp_check_time()
tries to update the time. The time is used for time stamps during logging the running data, and correct time stamps of the SD card files.
- HW initialization is done in
void dispod_display_initialize()
- functions to udpate the data to display on the TFT are provided
- functions to actually draw the screens are provided
- structures to hold the data are given
- functions to calculate the mean to smoothen the received values from the BLE device are provided
- data structures and functions to store the running data in an array an to bulk write to SD card as soon as at least one buffer is complete.
- functions to output a beep are provided (will be used for the metronome) are provided.
components/button
components/general/debugs
(unused)components/general/ota
(unused)components/general/param
(unused)components/wifi_conn
(unused)
components/spidriver
components/tft
tools/
main/tft_demo.c
used as a basis for my own programming
- From
dispod_gattc.c
for each BLE notification received the functiongattc_profile_event_handler()
will be called for anESP_GATTC_NOTIFY_EVT
event - the payload is deserialized
- the element containing the data (RSC or custom profile) will be put in the
running_values_queue
using thetypedef struct running_values_queue_element_t
.
- task is blocked until the queue
running_values_queue
contains at least one element. - the head element will be removed from the queue
- this item will be stored in the archivers buffer (w/o any queue)
- and also the values will be used to smoothen the values to display and hand over to the
dispod_screen_task
, a call to TODO (w/o any queue)
- blocked until
DISPOD_DISPLAY_UPDATE_BIT
indispod_display_evg
set - update the screen or change the screen (e.g. from status to running values )
- if a buffer is completed, write to disk
- if
DISPOD_SD_WRITE_COMPLETED_BUFFER_EVT
in the event groupEventGroupHandle_t dispod_sd_evg
is set, write all completed buffers to SD card - if
DISPOD_SD_WRITE_CURRENT_BUFFER_EVT
in the event groupEventGroupHandle_t dispod_sd_evg
is set, write the current (partial) buffer to SD card
- Font: DEJAVU24_FONT
- xPad = 10
- 10 (xPad) + 60 (XXX) + 10 (xPad) + 60 (123) + 20 (2*xPad) + 150 Indikator/Fields/... + 10 (xPad)
- Indikator x
AKAEM@PC MINGW32 ~/esp/disPOD $ grep -e "DISPOD_UPDATER.*0x2a53" -e "DISPOD_UPDATER.0xFF00" -e "val2dis" -e "DISPOD_RUNVALUES.," Logs/logs.txt
Pattern to look for
I (25905) DISPOD_UPDATER: received from queue: 0x2a53: C 97 I (25936) DISPOD_RUNVALUES: dispod_runvalues_calculate_display_values(), cadence 97 I (25999) DISPOD_UPDATER: received from queue: 0xFF00: Str 1 Sta 262 I (26027) DISPOD_RUNVALUES: dispod_runvalues_calculate_display_values(), GCT 262, strike 1 I (26036) DISPOD_RUNVALUES: dispod_runvalues_calculate_display_values(), cad [ 97 0 0 0 0], num 1, sum 97, val2dis 194 I (26048) DISPOD_RUNVALUES: dispod_runvalues_calculate_display_values(), GCT [262 0 0 0 0], num 1, sum 262, val2dis 262 I (26061) DISPOD_RUNVALUES: dispod_runvalues_calculate_display_values(), str [ 1 0 0 0 0], num 1, sum 1, val2dis 10
components\arduino\cores\esp32\IPAddress.h -> comment out last line // const IPAddress INADDR_NONE(0, 0, 0, 0);
NeoPixelBus -> change in component.mk COMPONENT_SRCDIRS := src src/internal . COMPONENT_ADD_INCLUDEDIRS := src src/internal .