2023-04-23 |
Clock: Add ability to convert from microseconds to kernel time
...
This functionality allows us to ask the kernel to schedule events
based on a high resolution real-time clock.
An example in main waits until the next second.
Jookia
committed
on 23 Apr 2023
|
Clock: Combine clocks to create a high resolution real-time clock
...
The kernel clock is high resolution but only tracks uptime.
The RTC clock is low resolution but tracks real time.
The NTP clock is high resolution but costly to access.
We can combine the kernel clock with a real-time clock of any type
by sporadically calculating the time the system was booted at then
adding the kernel's uptime to it whenever we need a new clock.
Jookia
committed
on 23 Apr 2023
|
2023-04-22 |
Clock: Clean up and document the code
Jookia
committed
on 22 Apr 2023
|
Clock: Use microseconds instead of struct timeval
...
timevals are a little annoying to work with compared to just microseconds,
so switch to using them for our clock API.
Jookia
committed
on 22 Apr 2023
|
Clock: Print microseconds in ISO 8601 strings
Jookia
committed
on 22 Apr 2023
|
Clock: Add _now suffix and variants for clock functions
...
Currently the clock code implicitly grabs the current time.
Add variants that let you pass in your own time value, and specify
extra _now functions that use the current time.
Jookia
committed
on 22 Apr 2023
|
CMakeLists: Apply compile options to Mbed too
...
This was my original intention but I guess I had things in the wrong order.
Jookia
committed
on 22 Apr 2023
|
2023-04-05 |
main: Disable color tracing
...
Color tracing was really messing with grabserial and minicom.
Jookia
committed
on 5 Apr 2023
|
Merge pull request #16 from LuminaSensum/networking_rework
...
NetworkHandler: make status callback private, reorder functions
Jookia
committed
on 5 Apr 2023
|
NetworkHandler: make status callback private, reorder functions
...
The status callback function now gets privately declared at the earliest
possible moment, to both allow for reordering of code and avoid calling
this function directly from any other part of the code
* void changed to static void in status_callback declaration
* this now makes it possible to define network_init before
status_callback, as status_callback is declared much earlier
Xogium
committed
on 5 Apr 2023
|
2023-04-04 |
Merge pull request #15 from LuminaSensum/sntp
...
Add SNTP clock syncing
Xogium
committed
on 4 Apr 2023
|
sntp: clang-format
Jookia
committed
on 4 Apr 2023
|
sntp: Timeout if gethostbyname fails
Jookia
committed
on 4 Apr 2023
|
main: Setup and sync clock when 3 presses are read
Jookia
committed
on 4 Apr 2023
|
Clock: Add our clock
...
This clock is intended to be used to get a timeval with sub-second
accuracy and convert it back and forth between kernel and real time.
Jookia
committed
on 4 Apr 2023
|
NetworkHandler: All access to the underlying NetworkInterface
...
We need this to actually use the network.
Jookia
committed
on 4 Apr 2023
|
sntp: Add SNTP fork
...
This fork of SNTP uses code from https://github.com/howerj/sntp with
many changes by Casey and I to run on mbed.
Jookia
committed
on 4 Apr 2023
|
2023-04-01 |
Merge pull request #14 from LuminaSensum/networking
...
Networking: added function and cleaned up
Jookia
committed
on 1 Apr 2023
|
2023-03-31 |
NetworkHandler: replace redundant include of EthernetInterface
...
The NetworkHandler header already includes EthernetInterface.h, so this
was redundant. It's also better in the future to not have the
NetworkHandler code directly require EthernetInterface.h, to allow for
versatile usage.
Xogium
committed
on 31 Mar 2023
|
NetworkHandler: added a new function to check weather we're connected
...
This now uses an atomic boolean to be thread safe.
Xogium
committed
on 31 Mar 2023
|
Merge pull request #13 from LuminaSensum/networking
...
Added networking support
Jookia
committed
on 31 Mar 2023
|
Added networking support
...
Networking is handled by the NetworkHandler portion of the code, which
provides a few functions for use by other parts of the program, and a
status callback to monitor for connectivity changes. Connectivity is
also handled in an asynchronous mode, to avoid freezing the entire OS
while actions are performed.
* network_connect should be called by any part of the program wishing to
establish connectivity
* network_disconnect should be called to disconnect the network once
done
* network_init is a special function which should only be called by
main. It is responsible for setting the network interface in
asynchronous mode as well as attaching the status monitor callback. No
other part of the program should ever call this.
Lwip is used for the network stack, and IPv6 support has been enabled,
and prefered over IPv4 if available.
Xogium
committed
on 31 Mar 2023
|
2023-03-30 |
Merge pull request #12 from LuminaSensum/WIP_tracing
...
switch to the tracing subsystem of mbed
Xogium
committed
on 30 Mar 2023
|
CMakeLists: Add option to enable tracing (on by default)
Jookia
committed
on 30 Mar 2023
|
main: Only enable tracing if it's enabled in Mbed
...
GCC will whine about unused variables if we try to set up tracing and
Mbed implements it as a no-op. Wrap this in an a compile-time check.
Jookia
committed
on 30 Mar 2023
|
Make use of the mbed tracing subsystem instead of basic printing
...
This enables use of the mbed tracing subsystem for the entire source
code of the project. All the uses of printfs are now appropriately
tagged and assigned a trace level, as in the following example:
[INFO][FS]: Unmounting the filesystem...
[INFO][FS]: OK
[INFO][USBM]: Switching to the usb mass storage mode...
[INFO][USBM]: Disconnecting the usb mass storage device...
[INFO][USBM]: Switched usb mass storage mode off.
[INFO][FS]: Mounting the filesystem...
[INFO][FS]: OK
This was also done in a way that the tracing is thread safe, using a
mutex to lock and unlock as needed.
Note that this cannot be turned on or off yet during build. It is
currently always enabled.
Xogium
committed
on 30 Mar 2023
|
2023-03-26 |
Merge pull request #11 from LuminaSensum/cleanup
...
reworked the main loop
Jookia
committed
on 26 Mar 2023
|
src/main: reworked the main loop
...
With the latest code cleanup, issues were introduced regarding the mounting and
unmounting of the filesystem.
* Sometimes the board would wake up from sleep and perform mounting and
unmounting of the filesystem in a more or less short loop before going
back to sleep. I suspect this might be due to the sleep getting
interrupted without any button press, aka every 10 minutes or so.
* This code also created a bug where it would create then mount a new
filesystem on the flash after erasing it, breaking the purpose for that
function in the first place which is to erase the flash and nothing
else.
Main is now calling mountFilesystem and unmountFilesystem where
appropriate:
* Before running doUSBMSD, main unmounts the filesystem. When doUSBMSD
is done, main once again mounts the filesystem.
* Before erasing the flash with doERASE, main unmounts the filesystem,
and never mounts it again.
* As a tidying up step, the filesystem gets unmounted, same as the
button thread terminating.
Xogium
committed
on 26 Mar 2023
|
2023-03-23 |
Merge pull request #10 from LuminaSensum/jookia/cleanup1
...
Various small cleanups
Xogium
committed
on 23 Mar 2023
|
main: Unmount filesystem on shutdown
Jookia
committed
on 23 Mar 2023
|