Commit Graph

10 Commits

Author SHA1 Message Date
mark9064
1fb70a2490
Fixes for PR 2046 (SPI transaction hooks) (#141) 2024-05-03 22:40:59 +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
7613571f96 sim: support upstream Watchdog driver improvement
Fixes: https://github.com/InfiniTimeOrg/InfiniSim/issues/101
2023-05-01 21:44:29 +02:00
Reinhold Gschweicher
9427d4ddb1 SpiNorFlash: check Read/Write for out of bounds
Just to be extra pedantic and to get an error while developing on
InfiniSim. Because on PC we can easily add the debugger, on the device
we can, but it is a bit more involved.
2022-05-15 22:47:41 +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
NeroBurner
de8d0d6b6f SpiNorFlash: code style fix 2022-04-24 19:13:56 +02:00
Reinhold Gschweicher
7194e3e38e SpiNorFlash: use C++ style struct in C++ only header
`SpiNorFlash.h` is a C++ header, but the `Identification` struct is
created in a C style using `typedef struct`. Clang issues a warining
about this discrepancy:

```
In file included from /home/nero/repos/pinetime/InfiniSim/InfiniTime/src/systemtask/SystemTask.cpp:13:
/home/nero/repos/pinetime/InfiniSim/sim/drivers/SpiNorFlash.h:16:21: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]
      typedef struct __attribute__((packed)) {
                    ^
                     Identification
/home/nero/repos/pinetime/InfiniSim/sim/drivers/SpiNorFlash.h:17:9: note: type is not C-compatible due to this default member initializer
        uint8_t manufacturer = 0;
        ^~~~~~~~~~~~~~~~~~~~
/home/nero/repos/pinetime/InfiniSim/sim/drivers/SpiNorFlash.h:20:9: note: type is given name 'Identification' for linkage purposes by this typedef declaration
      } Identification;
        ^
1 warning generated.
```

The easy fix is to use a C++ style struct.

Same fix as in: https://github.com/InfiniTimeOrg/InfiniTime/pull/1046
2022-04-24 19:13:56 +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
f19355949b Initial InfiniSim project 2022-02-17 22:57:08 +01:00