Commit Graph

13 Commits (068c5a823e3ad14e47192528a34aabe7e904c88c)

Author SHA1 Message Date
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 +07: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 +07: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 +07:00
Reinhold Gschweicher 7110fa0034 cmake: create QCBOR target and link to InfiniSim 2022-04-08 11:26:30 +07: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 +07:00
Reinhold Gschweicher 6567a67aef cmake: add a status message which MONITOR_ZOOM is used 2022-03-30 22:15:02 +07: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 +07:00
Reinhold Gschweicher 00ccde99e9 Add install target to create system packages 2022-03-19 00:57:53 +07: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 +07: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 +07: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 +07: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 +07:00
Reinhold Gschweicher f19355949b Initial InfiniSim project 2022-02-17 22:57:08 +07:00