Add a new command `littlefs-do res load resource.zip` which loads
resources from a zip file to the SPI raw file.
Below an example `resource.zip` is loaded:
```sh
$ ./littlefs-do res load infinitime-resources-1.10.0.zip --verbose
Calling FS::Init()
running 'res'
running 'res load'
loading resource file: "infinitime-resources-1.10.0.zip"
zip: num of files in zip: 8
copy file teko.bin from zip to SPI path '/teko.bin'
copy file lv_font_dots_40.bin from zip to SPI path '/lv_font_dots_40.bin'
copy file 7segments_40.bin from zip to SPI path '/7segments_40.bin'
copy file bebas.bin from zip to SPI path '/bebas.bin'
copy file 7segments_115.bin from zip to SPI path '/7segments_115.bin'
copy file matrix.bin from zip to SPI path '/matrix.bin'
copy file infineat-1.bin from zip to SPI path '/infineat-1.bin'
finished: zip file fully loaded into SPI memory: infinitime-resources-1.10.0.zip
```
Afterwards the files are listed in the SPI raw file:
```sh
$ ./littlefs-do ls
type: DIR
name: /
type: DIR name: .
type: DIR name: ..
type: REG size: 4928 name: 7segments\_115.bin
type: REG size: 760 name: 7segments\_40.bin
type: REG size: 4420 name: bebas.bin
type: REG size: 1430 name: infineat-1.bin
type: REG size: 1840 name: lv\_font\_dots\_40.bin
type: REG size: 115204 name: matrix.bin
type: REG size: 440 name: teko.bin
```
Fixes: https://github.com/InfiniTimeOrg/InfiniSim/issues/55
Add helper to modify spi raw file, to make experimenting with it easier.
```sh
$ ./littlefs-do --help
Usage: ./littlefs-do <command> [options]
Commands:
-h, --help show this help message for the selected command and exit
-v, --verbose print status messages to the console
stat show information of specified file or directory
ls list available files in 'spiNorFlash.raw' file
mkdir create directory
rmdir remove directory
rm remove directory or file
cp copy files into or out of flash file
settings list settings from 'settings.h'
```
In the process restructure the CMake file for less duplicate
includes/defines for both executables (`infinisim` and `littlefs-do`).
Upload the `littlefs-do` binary built by the CI additionally to the `infinisim` binary.
Use the updated upload-artifact@v3 template to do that.
Support changes in InfiniTimeOrg/InfiniTime#1258
The file `lv_pinetime_theme.c` is renamed to `InfiniTimeTheme.cpp`.
Need to pick up that change in the simulator to compile with the new cpp
file if it exists.
Furthermore use the new `InfiniTimeTheme.h` header in simulator files.
Fixes: https://github.com/InfiniTimeOrg/InfiniSim/issues/49
Press key `I` (shift+`i`) to start a screen capture creating a gif with
the captured screen. Hit `I` again to stop the screen recording.
---
Add gif-h helper header only library
Copied from https://github.com/charlietangora/gif-h3d2657b9ad
Remove the custom MotorController class and use the upstream
MotorController instead.
To enable this move add custom code in nrf_gpio to handle the Motor pin
instead of the custom motor_is_running member variable.
Also implement the repeating app_timer type used in the upstream
MotorController.
The external SPI flash is implemented as a 4MB on the local filesystem.
This allows the FS (littleFS) and settings to work properly.
Remove the simulated `FS.h` and `FS.cpp`, because we can now use
the files from InfiniTime directly as the heavy lifting is done in the simulated
`SpiNorFlash.h` and cpp files.
`SpiNorFlash.h` provides read and write functions with `uint8_t` buffer, but
`fs::fstream` expects `char` buffer. Use `reinterpret_cast` and check if by
any chance the `char` type on a platform is implemented with more
than one byte. Then the `reinterpret_cast<char *>(buffer)` would change the
meaning of the `size` parameter, which could lead to garbage data.
Co-authored-by: Reinhold Gschweicher <pyro4hell@gmail.com>
https://github.com/InfiniTimeOrg/InfiniTime/pull/1136 adds a new folder `widgets`
for source files.If it gets merged, this folder needs to be added to the build.
Add the source files to InfiniSim if the new folder exists
Since https://github.com/InfiniTimeOrg/InfiniTime/pull/1097 the fonts
are generated. Support this new way of using fonts.
When InfiniTime isn't a subdirectory of InfiniSim we need to provide
the binary dir when using `add_subdirectory()`. Use `fonts`.
Update README with instructions to install `lv_font_conv`.
The lv_drivers provided monitor driver supports a `MONITOR_ZOOM`-factor
which scales the window by the set factor. This is 'useful when
simulating small screens'.
The zoom can be set as cmake configuration setting `-DMONITOR_ZOOM=1`.
Probably even more usefull for high-dpi screens where 240 pixels is
really tiny.
To make the simulator work without modification for more PRs use the
original `lv_conf.h` file and modify the needed parts for the simulator.
Furthermore use globbing expressions to add all available fonts and
icons in case a PR adds new fonts or icons.
When pressing `i` create a screenshot of the current InfiniTime screen
by dumping it to a timestamped png or bmp file like
`InfiniSim_2022-03-08_203421.png`.
Add a new configure option `WITH_PNG` with default `ON`. When switched
to `OFF` the screenshots will be created in `bmp` format.
Fixes: https://github.com/InfiniTimeOrg/InfiniSim/issues/5
With the old default of just "InfiniTime" you have to have the working
directory in the `InfiniSim` directory. The new default makes the
default independent of the current working directory.