Skip to content

Commit 786d805

Browse files
fix sdkconfig for esp32s2
1 parent 6c41b68 commit 786d805

File tree

272 files changed

+68276
-151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+68276
-151
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ jobs:
1010
- name: Build
1111
run: |
1212
docker build -t esp32-javascript:latest -f tools/Dockerfile .
13-
docker run --name esp32-javascript-build -t esp32-javascript:latest bash -c './tools/build.sh'
13+
docker run --name esp32-javascript-build-esp32 -t esp32-javascript:latest bash -c './tools/build.sh'
14+
docker run --name esp32-javascript-build-esp32s2 --env IDF_TARGET=esp32s2 -t esp32-javascript:latest bash -c './tools/build.sh'
1415
1516
#### Commented out due to unavailability of e2e api
1617
# docker cp 'esp32-javascript-build:/opt/esp32-javascript/build.tar.gz' .

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ sdkconfig.old*
33
main/project.cpp
44
main/project.c
55
node_modules
6+
sdkconfig

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,20 @@ Change into ~/esp/esp32-javascript.
3737

3838
Maybe you want to change the BOARD_VARIANT in the ./CMakeLists.txt file.
3939

40+
4041
First build the project with
4142

4243
```shell
44+
#for ESP32
4345
idf.py build
46+
47+
#for ESP32-S2
48+
idf.py -DIDF_TARGET=esp32s2 build
4449
```
4550

51+
If you have an ESP32-S2 device build it like this:
52+
53+
4654
Connect your ESP32 Dev Board via USB and run
4755

4856
```shell
@@ -95,6 +103,7 @@ You can clean the project by executing
95103
idf.py fullclean
96104
```
97105

106+
If you want to use all the esp32-javascript defaults for your sdkconfig. Remove `./sdkconfig` file. This file will be recreated the next build with all the defaults.
98107
### Factory reset
99108

100109
You can erase the persistent flash memory, which will be equivalent to a factory reset, by executing
@@ -105,8 +114,10 @@ You can erase the persistent flash memory, which will be equivalent to a factory
105114

106115
## Compatibility
107116

117+
### Devices
118+
Tested with ESP32 WROVER and ESP-S2 WROVER devices.
119+
### ESP-IDF
108120
Tested with esp-idf [release/v4.2](https://github.com/espressif/esp-idf/tree/release/v4.2)
109-
110121
## API
111122

112123
[API documentation](docs/README.md)

babel.config.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"presets": ["minify"],
3-
"plugins": ["transform-remove-console"]
2+
"presets": ["minify"]
43
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
idf_component_register(SRC_DIRS "." "./libb64"
2-
INCLUDE_DIRS "include" "$ENV{BOARD_VARIANT}"
2+
INCLUDE_DIRS "include" "include/$ENV{IDF_TARGET}" "$ENV{BOARD_VARIANT}"
33
REQUIRES "nvs_flash" "app_update" "esp_adc_cal")
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Copyright 2019 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
/*******************************************************************************
16+
* NOTICE
17+
* The hal is not public api, don't use in application code.
18+
* See readme.md in hal/include/hal/readme.md
19+
******************************************************************************/
20+
21+
// The HAL layer for ADC (esp32 specific part)
22+
23+
#pragma once
24+
25+
#include "hal/adc_ll.h"
26+
#include "hal/adc_types.h"
27+
28+
#include_next "hal/adc_hal.h"
29+
30+
#ifdef __cplusplus
31+
extern "C" {
32+
#endif
33+
34+
/*---------------------------------------------------------------
35+
Digital controller setting
36+
---------------------------------------------------------------*/
37+
38+
/**
39+
* Set I2S DMA data source for digital controller.
40+
*
41+
* @param src i2s data source.
42+
*/
43+
#define adc_hal_digi_set_data_source(src) adc_ll_digi_set_data_source(src)
44+
45+
/*---------------------------------------------------------------
46+
Common setting
47+
---------------------------------------------------------------*/
48+
49+
/*---------------------------------------------------------------
50+
Hall sensor setting
51+
---------------------------------------------------------------*/
52+
53+
/**
54+
* Enable hall sensor.
55+
*/
56+
#define adc_hal_hall_enable() adc_ll_hall_enable()
57+
58+
/**
59+
* Disable hall sensor.
60+
*/
61+
#define adc_hal_hall_disable() adc_ll_hall_disable()
62+
63+
/**
64+
* Start hall convert and return the hall value.
65+
*
66+
* @return Hall value.
67+
*/
68+
int adc_hal_hall_convert(void);
69+
70+
#ifdef __cplusplus
71+
}
72+
#endif
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#pragma once
16+
17+
#define SOC_ADC1_DATA_INVERT_DEFAULT (1)
18+
#define SOC_ADC2_DATA_INVERT_DEFAULT (1)
19+
20+
#define SOC_ADC_DIGI_DATA_INVERT_DEFAULT(PERIPH_NUM) (1)
21+
22+
#define SOC_ADC_FSM_RSTB_WAIT_DEFAULT (8)
23+
#define SOC_ADC_FSM_START_WAIT_DEFAULT (SOC_ADC_DIGI_SAR_CLK_DIV_DEFAULT)
24+
#define SOC_ADC_FSM_STANDBY_WAIT_DEFAULT (100)
25+
#define ADC_FSM_SAMPLE_CYCLE_DEFAULT (2)
26+
27+
#define SOC_ADC_PWDET_CCT_DEFAULT (4)
28+
29+
#define SOC_ADC_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) (2)
30+
31+
#define SOC_ADC_DIGI_SAR_CLK_DIV_DEFAULT (16)

0 commit comments

Comments
 (0)