Commit Graph

39 Commits

Author SHA1 Message Date
FintasticMan
3ba07f574e
Fix build for motion service improvement (#139)
Fixes the build after InfiniTimeOrg/InfiniTime#1970 was merged.
2024-01-23 23:13:28 +01:00
JF
46f2e0d16f
User apps selection with CMake (#134)
Integrate the new `infinitime_apps` library and enable user applications
selection using the CMake variable `ENABLE_USERAPPS`.

Update InfiniTime to after CMake user app selection merged
2023-12-23 21:54:05 +01:00
JF
d6cc458ea2
Integration of Simple Weather Service (#135)
* Integration of Simple Weather Service

Replace the old WeatherService by the new Simple Weather Service.=

* Update InfiniTime to after SimpleWeatherService got merged

---------

Co-authored-by: Reinhold Gschweicher <pyro4hell@gmail.com>
2023-12-23 21:35:14 +01:00
Max Friedrich
39b9b17625
Fix CMP0153 for newer CMake versions (#133)
Fixes deprecated call and replaces it with
execute_process
https://cmake.org/cmake/help/latest/policy/CMP0153.html#policy:CMP0153

Co-authored-by: minacode <minamoto9@web.de>
2023-12-11 22:12:54 +01:00
JF
1f33754c1a
Enable C++20 in CMake (needed since InfiniTime is switch to C++20 as well). (#129) 2023-11-11 18:09:54 +01:00
NeroBurner
02f2cc5a05
Node v14 required for lv_font_conv (#122)
* Update miminum node version to v14+ as lv_font_conv minimum

The current readme of the `lv_font_conv` the minimum node.js version is
v14+. Update our readme to mention that minimum version as well.

https://github.com/lvgl/lv_font_conv#install-the-script

---

In Check node version and issue a warning if less than v14.0.0.

Fixes: https://github.com/InfiniTimeOrg/InfiniSim/issues/109
2023-09-17 20:54:59 +02:00
Reinhold Gschweicher
f4b729e00b Remove libpng submodule and require system lib
On rolling distros the usage of `libpng` submodule makes problems as the
`zlib` system dependency of said module gets updated. Then the submodule
regularly is too old to handle the updates `zlib` dependency.

Fix this maintenance churn by requiring `libpng` as system library as
well. Then the distros package manager keeps those versions in sync.

This unfortunately requires users to install a new runtime/build
dependency, but it still can be disabled with `-DWITH_PNG=OFF`.
2023-09-07 19:06:56 +02:00
Finlay Davidson
3910552a7b raisewake: Fix for new raise to wake impl 2023-08-20 18:29:41 +02:00
Jean-François Milants
f49bf98151 Fix for the new analog watch face implementation in InfiniTime
The new analog watch face implementation in InfiniTime draws the background programmatically instead of using a background picture. This branch removes this background picture from the files needed by cmake to build the project.
2023-08-15 12:18:48 +02:00
Reinhold Gschweicher
aa34f93161 sim: embedd background bmp and load from memory
Loading the file from disk introduces a slight dependency on the working
directory for the simulator. Prevent that by loading the bmp from
memory.

Use a python script to convert the backround bmp image to a C header
file. Include this header in `main.cpp` and load the bmp from memory.
2023-05-08 18:32:50 +02:00
Reinhold Gschweicher
2e746ea560 use drivers/Hrs3300.h from InfiniTime
The Hrs3300.h driver can now be used directly from InfiniTime. Some
other improvement made that possible. One less simulator file, one less
file to keep updated. Win-Win (for me at least).
2023-05-03 21:16:30 +02:00
Reinhold Gschweicher
4b0c2dc3eb Use InfiniTime Watchdog.h by providing mdk/nrf.h and others 2023-05-03 20:59:58 +02:00
Reinhold Gschweicher
6541af6170 Support TimerController rename to Timer
Improvement done in https://github.com/InfiniTimeOrg/InfiniTime/pull/1650
2023-05-01 20:58:27 +02:00
Reinhold Gschweicher
32fada34f4 Support rename of TimerController to FreeRTOS::Timer 2023-03-02 22:33:05 +01:00
Reinhold Gschweicher
02f980f278 sim: LittleVgl: update s.t. LVGL-FS driver is initialized by LittleVgl
InfiniTime moved the LVGL-FS driver initialization to the LittleVgl
constructor and passed the FS member to do that.

Update the simulator copy of LittleVgl to do just that.

Fixes: https://github.com/InfiniTimeOrg/InfiniSim/issues/89
2023-02-26 23:42:03 +01:00
Reinhold Gschweicher
36c69bbc2e main: use ctime put_time to replace date/date.h include
Implementation referenced from:
https://stackoverflow.com/questions/17223096/outputting-date-and-time-in-c-using-stdchrono

Fixes: https://github.com/InfiniTimeOrg/InfiniSim/issues/88
2023-02-26 22:44:15 +01:00
Riku Isokoski
322092e2ef Remove unused app_timer library
This is no longer used in InfiniTime, and I can't see any reason it
would ever be used again.
2023-02-25 19:49:58 +02:00
Riku Isokoski
3be951690c Remove unused Missing screen
This class causes builds to fail every time screens are changed in
InfiniTime.
2023-02-25 19:49:58 +02:00
Paul
d6c266905b cmake: add explicit std::filesystem linking
Fix: https://github.com/InfiniTimeOrg/InfiniSim/issues/57
Supersede: https://github.com/InfiniTimeOrg/InfiniSim/pull/58
2023-01-18 17:26:10 +01:00
Reinhold Gschweicher
51f6de612a Add option BUILD_RESOURCES=ON to build resources.zip file
The `BUILD_RESOURCES` option is also available in `InfiniTime`, but we
don't want to require building the firmware to test `resource.zip` file
generation.
2022-10-11 22:31:14 +02:00
Reinhold Gschweicher
2306807a73 littlefs-do: unzip in memory and copy listed resources to SPI raw file
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
2022-09-08 20:02:48 +02:00
NeroBurner
9e15182af2
littlefs-do binary to work with spi raw file (#52)
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.
2022-08-29 12:05:21 +02:00
NeroBurner
b00dceb8c6
Support "Centralize most color definitions" (#50)
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
2022-08-15 13:46:42 +02:00
Reinhold Gschweicher
935bb175b1 cmake: support date submodule include dir
Support both the current modified `date/includes` directory and the
`date` submodules `date/include` directory.

Once https://github.com/InfiniTimeOrg/InfiniTime/pull/1183 is merged
and the InfiniTime submodule is checked in also update the GitHub Action
and the AUR package.

Fixes: https://github.com/InfiniTimeOrg/InfiniSim/issues/42
2022-06-26 22:15:09 +02:00
Reinhold Gschweicher
a594446ef0 Add gif-h helper to create screen capture
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-h

3d2657b9ad
2022-06-19 22:31:25 +02:00
NeroBurner
ce22ba29c9
Remove MotorController, use nrf_gpio Motor pin, apptimer repeat (#34)
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.
2022-06-05 22:03:53 +02:00
JF
644431cbc4
Add support for SpiNorFlash and FS (#30)
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>
2022-05-15 22:15:19 +02:00
Riku Isokoski
b1fbae36f9
Build widgets in widgets folder (#31)
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
2022-05-15 21:13:24 +02:00
Reinhold Gschweicher
f0c6ef9cd6 Use infinitime_fonts target if fonts/CMakeLists.txt 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`.
2022-05-14 21:31:26 +02:00
Reinhold Gschweicher
7110fa0034 cmake: create QCBOR target and link to InfiniSim 2022-04-08 11:26:30 +02:00
Reinhold Gschweicher
d4e81ca177 Fix libpng submodule usage
The current usage used the system `png.h` header instead of the intended
submodule header. This may break if the system header isn't at
`libpng16/png.h`.

Fix the include header to get the genreated include files and the
`png.h` from the submodule as described in
https://github.com/glennrp/libpng/issues/342#issuecomment-864589614

Fixes: https://github.com/InfiniTimeOrg/InfiniSim/issues/19
2022-04-03 21:35:09 +02:00
Reinhold Gschweicher
6567a67aef cmake: add a status message which MONITOR_ZOOM is used 2022-03-30 22:15:02 +02:00
Reinhold Gschweicher
bf3a255ca4 Cst816s: scale down SDL mouse coordinates according to MONITOR_ZOOM
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.
2022-03-30 20:51:41 +02:00
Reinhold Gschweicher
00ccde99e9 Add install target to create system packages 2022-03-19 00:57:53 +01:00
Reinhold Gschweicher
eb7b589826 cmake: use main lv_conf.h, use file globs for fonts and icons
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.
2022-03-09 23:17:57 +01:00
Reinhold Gschweicher
dfbc345511 main: implement saveScreenshot() writing bmp/png from SDL window buffer
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
2022-03-08 21:39:16 +01:00
Reinhold Gschweicher
1728317544 cmake: add SystemMonitor.cpp
https://github.com/InfiniTimeOrg/InfiniTime/pull/967 splits
SystemMonitor.h into a h and cpp file. Add the cpp file to the infinisim
target.
2022-03-07 22:20:22 +01:00
Reinhold Gschweicher
a79f75285f cmake: improve InfiniTime_DIR default
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.
2022-02-20 22:27:10 +01:00
Reinhold Gschweicher
f19355949b Initial InfiniSim project 2022-02-17 22:57:08 +01:00