move hal files from /src to /shared
This commit is contained in:
parent
c73b190137
commit
2deaec1aed
@ -14,24 +14,24 @@ You can add up to 3 user defined sensors. Insert your sensor's payload scheme in
|
|||||||
|
|
||||||
For these peripherals no additional code is needed. To activate configure them in the board's hal file before building the code.
|
For these peripherals no additional code is needed. To activate configure them in the board's hal file before building the code.
|
||||||
|
|
||||||
See [`generic.h`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/hal/generic.h) for all options and for proper configuration of BME280/BME680.
|
See [`generic.h`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/shared/hal/generic.h) for all options and for proper configuration of BME280/BME680.
|
||||||
|
|
||||||
=== "BME/ BMP Configuration"
|
=== "BME/ BMP Configuration"
|
||||||
```c linenums="37" title="src/hal/generic.h"
|
```c linenums="37" title="shared/hal/generic.h"
|
||||||
--8<-- "src/hal/generic.h:37:49"
|
--8<-- "shared/hal/generic.h:37:49"
|
||||||
```
|
```
|
||||||
=== "SDS011 Configuration"
|
=== "SDS011 Configuration"
|
||||||
```c linenums="51" title="src/hal/generic.h"
|
```c linenums="51" title="shared/hal/generic.h"
|
||||||
--8<-- "src/hal/generic.h:51:56"
|
--8<-- "shared/hal/generic.h:51:56"
|
||||||
```
|
```
|
||||||
=== "Custom Sensors Configuration"
|
=== "Custom Sensors Configuration"
|
||||||
```c linenums="57" title="src/hal/generic.h"
|
```c linenums="57" title="shared/hal/generic.h"
|
||||||
--8<-- "src/hal/generic.h:57:60"
|
--8<-- "shared/hal/generic.h:57:60"
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "Complete `generic.h`"
|
=== "Complete `generic.h`"
|
||||||
```c linenums="1" title="src/hal/generic.h"
|
```c linenums="1" title="shared/hal/generic.h"
|
||||||
--8<-- "src/hal/generic.h"
|
--8<-- "shared/hal/generic.h"
|
||||||
```
|
```
|
||||||
|
|
||||||
Output of user sensor data can be switched by user remote control command `0x14` sent to Port 2.
|
Output of user sensor data can be switched by user remote control command `0x14` sent to Port 2.
|
||||||
@ -77,10 +77,10 @@ Paxcounter can keep a time-of-day synced with external or on board time sources.
|
|||||||
--8<-- "src/paxcounter_orig.conf:88:88"
|
--8<-- "src/paxcounter_orig.conf:88:88"
|
||||||
```
|
```
|
||||||
|
|
||||||
Supported external time sources are GPS, LORAWAN network time and LORAWAN application timeserver time. Supported on board time sources are the RTC of ESP32 and a DS3231 RTC chip, both are kept sycned as fallback time sources. Time accuracy depends on board's time base which generates the pulse per second. Supported are GPS PPS, SQW output of RTC, and internal ESP32 hardware timer. Time base is selected by #defines in the board's hal file, see example in [`generic.h`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/hal/generic.h).
|
Supported external time sources are GPS, LORAWAN network time and LORAWAN application timeserver time. Supported on board time sources are the RTC of ESP32 and a DS3231 RTC chip, both are kept sycned as fallback time sources. Time accuracy depends on board's time base which generates the pulse per second. Supported are GPS PPS, SQW output of RTC, and internal ESP32 hardware timer. Time base is selected by #defines in the board's hal file, see example in [`generic.h`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/shared/hal/generic.h).
|
||||||
|
|
||||||
```c linenums="87" title="src/hal/generic.h"
|
```c linenums="87" title="shared/hal/generic.h"
|
||||||
--8<-- "src/hal/generic.h:87:96"
|
--8<-- "shared/hal/generic.h:87:96"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ This describes how to set up a mobile PaxCounter:<br> Follow all steps so far fo
|
|||||||
|
|
||||||
## SD-card
|
## SD-card
|
||||||
|
|
||||||
Data can be stored on a FAT32 (pre-)formatted SD-card if the board provides an SD card interface, either with SPI or MMC mode. To enable this feature, specify interface mode and hardware pins in board's hal file (`src/hal/<board.h\>`):
|
Data can be stored on a FAT32 (pre-)formatted SD-card if the board provides an SD card interface, either with SPI or MMC mode. To enable this feature, specify interface mode and hardware pins in board's hal file (`shared/hal/<board.h\>`):
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define HAS_SDCARD 1 // SD-card interface, using SPI mode
|
#define HAS_SDCARD 1 // SD-card interface, using SPI mode
|
||||||
@ -126,10 +126,10 @@ Data can be stored on a FAT32 (pre-)formatted SD-card if the board provides an S
|
|||||||
#define SDCARD_SCLK (14)
|
#define SDCARD_SCLK (14)
|
||||||
```
|
```
|
||||||
|
|
||||||
This is an example of a board with MMC SD-card interface: [https://www.aliexpress.com/item/32915894264.html](https://www.aliexpress.com/item/32915894264.html). For this board use file [`src/hal/ttgov21new.h`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/src/hal/ttgov21new.h) and add the lines given above.
|
This is an example of a board with MMC SD-card interface: [https://www.aliexpress.com/item/32915894264.html](https://www.aliexpress.com/item/32915894264.html). For this board use file [`shared/hal/ttgov21new.h`](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/shared/hal/ttgov21new.h) and add the lines given above.
|
||||||
|
|
||||||
Another approach would be this tiny board: [https://www.aliexpress.com/item/32424558182.html](https://www.aliexpress.com/item/32424558182.html) (needs 5V).
|
Another approach would be this tiny board: [https://www.aliexpress.com/item/32424558182.html](https://www.aliexpress.com/item/32424558182.html) (needs 5V).
|
||||||
In this case you choose the correct file for your ESP32-board in the src/hal-directory and add the lines given above. Edit the pin numbers given in the example, according to your wiring.
|
In this case you choose the correct file for your ESP32-board in the shared/hal-directory and add the lines given above. Edit the pin numbers given in the example, according to your wiring.
|
||||||
|
|
||||||
Data is written on SD-card to a single file. After 3 write operations the data is flushed to the disk to minimize flash write cycles. Thus, up to the last 3 records of data will get lost when the Paxcounter looses power during operation.
|
Data is written on SD-card to a single file. After 3 write operations the data is flushed to the disk to minimize flash write cycles. Thus, up to the last 3 records of data will get lost when the Paxcounter looses power during operation.
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ Depending on board hardware following features are supported:
|
|||||||
- SD-card (see section SD-card here) for logging pax data
|
- SD-card (see section SD-card here) for logging pax data
|
||||||
|
|
||||||
Target platform must be selected in `platformio.ini`.<br>
|
Target platform must be selected in `platformio.ini`.<br>
|
||||||
Hardware dependent settings (pinout etc.) are stored in board files in [/hal](https://github.com/cyberman54/ESP32-Paxcounter/tree/master/src/hal) directory. If you want to use a ESP32 board which is not yet supported, use hal file generic.h and tailor pin mappings to your needs. Pull requests for new boards welcome.<br>
|
Hardware dependent settings (pinout etc.) are stored in board files in [/shared/hal](https://github.com/cyberman54/ESP32-Paxcounter/tree/master/shared/hal) directory. If you want to use a ESP32 board which is not yet supported, use hal file generic.h and tailor pin mappings to your needs. Pull requests for new boards welcome.<br>
|
||||||
|
|
||||||
### 3D printed cases
|
### 3D printed cases
|
||||||
Some 3D printable cases can be found (and, if wanted so, ordered) on Thingiverse, see
|
Some 3D printable cases can be found (and, if wanted so, ordered) on Thingiverse, see
|
||||||
|
@ -114,7 +114,7 @@ upload_speed = ${common.upload_speed}
|
|||||||
platform = ${common.platform_espressif32}
|
platform = ${common.platform_espressif32}
|
||||||
lib_deps = ${common.lib_deps_all}
|
lib_deps = ${common.lib_deps_all}
|
||||||
build_flags =
|
build_flags =
|
||||||
-include "src/hal/${board.halfile}"
|
-include "shared/hal/${board.halfile}"
|
||||||
${common.build_flags_all}
|
${common.build_flags_all}
|
||||||
extra_scripts = ${common.extra_scripts}
|
extra_scripts = ${common.extra_scripts}
|
||||||
monitor_speed = ${common.monitor_speed}
|
monitor_speed = ${common.monitor_speed}
|
||||||
@ -138,6 +138,6 @@ platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/
|
|||||||
|
|
||||||
[env:ci]
|
[env:ci]
|
||||||
build_flags =
|
build_flags =
|
||||||
-include "src/hal/${sysenv.CI_HALFILE}" ; set by CI
|
-include "shared/hal/${sysenv.CI_HALFILE}" ; set by CI
|
||||||
${common.build_flags_all}
|
${common.build_flags_all}
|
||||||
upload_protocol = esptool
|
upload_protocol = esptool
|
||||||
|
@ -53,7 +53,7 @@ upload_speed = ${common.upload_speed}
|
|||||||
platform = ${common.platform_espressif32}
|
platform = ${common.platform_espressif32}
|
||||||
lib_deps = ${common.lib_deps_all}
|
lib_deps = ${common.lib_deps_all}
|
||||||
build_flags =
|
build_flags =
|
||||||
-include "src/hal/${board.halfile}"
|
-include "shared/hal/${board.halfile}"
|
||||||
${common.build_flags_all}
|
${common.build_flags_all}
|
||||||
extra_scripts = ${common.extra_scripts}
|
extra_scripts = ${common.extra_scripts}
|
||||||
monitor_speed = ${common.monitor_speed}
|
monitor_speed = ${common.monitor_speed}
|
||||||
@ -64,6 +64,6 @@ upload_protocol = esptool
|
|||||||
|
|
||||||
[env:ci]
|
[env:ci]
|
||||||
build_flags =
|
build_flags =
|
||||||
-include "src/hal/${sysenv.CI_HALFILE}" ; set by CI
|
-include "shared/hal/${sysenv.CI_HALFILE}" ; set by CI
|
||||||
${common.build_flags_all}
|
${common.build_flags_all}
|
||||||
upload_protocol = esptool
|
upload_protocol = esptool
|
@ -23,7 +23,8 @@ config.read("platformio.ini")
|
|||||||
srcdir = env.get("PROJECT_SRC_DIR")
|
srcdir = env.get("PROJECT_SRC_DIR")
|
||||||
|
|
||||||
# get hal path
|
# get hal path
|
||||||
haldir = os.path.join (srcdir, "hal")
|
prjdir = env.get("PROJECT_DIR")
|
||||||
|
haldir = os.path.join (prjdir, "shared/hal")
|
||||||
|
|
||||||
# check if hal file is present in source directory
|
# check if hal file is present in source directory
|
||||||
halconfig = config.get("board", "halfile")
|
halconfig = config.get("board", "halfile")
|
||||||
|
Loading…
Reference in New Issue
Block a user