step 1 migrations to Espressif 1.1.0 core

This commit is contained in:
Klaus K Wilting 2018-07-04 00:09:25 +02:00
parent 308187aab6
commit 165aa75ab3
6 changed files with 15 additions and 25 deletions

View File

@ -11,9 +11,9 @@
; ---> SELECT TARGET PLATFORM HERE! <---
[platformio]
env_default = heltec
;env_default = heltec
;env_default = ttgov1
;env_default = ttgov2
env_default = ttgov2
;env_default = ttgov21
;env_default = ttgobeam
;env_default = lopy
@ -25,11 +25,11 @@ env_default = heltec
description = Paxcounter is a proof-of-concept ESP32 device for metering passenger flows in realtime. It counts how many mobile devices are around.
[common_env_data]
platform_espressif32 = espressif32@1.0.2
platform_espressif32 = espressif32@1.1.0
board_build.partitions = no_ota.csv
lib_deps_all =
lib_deps_display =
U8g2@>=2.22.14
U8g2@>=2.23.12
lib_deps_rgbled =
SmartLeds@>=1.1.3
lib_deps_gps =

View File

@ -249,14 +249,7 @@ void start_BLEscan(void) {
ESP_LOGI(TAG, "Initializing bluetooth scanner ...");
// Initialize BT controller to allocate task and other resource.
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
bt_cfg.controller_task_stack_size =
BLESTACKSIZE; // set BT stack size to value configured in paxcounter.conf
ESP_ERROR_CHECK(esp_bt_controller_init(&bt_cfg));
ESP_ERROR_CHECK(esp_bt_controller_enable(ESP_BT_MODE_BTDM));
// Init and alloc the resource for bluetooth stack, must be done prior to
// every bluetooth stuff
btStart();
ESP_ERROR_CHECK(esp_bluedroid_init());
ESP_ERROR_CHECK(esp_bluedroid_enable());
@ -271,8 +264,7 @@ void stop_BLEscan(void) {
ESP_ERROR_CHECK(esp_ble_gap_register_callback(NULL));
ESP_ERROR_CHECK(esp_bluedroid_disable());
ESP_ERROR_CHECK(esp_bluedroid_deinit());
ESP_ERROR_CHECK(esp_bt_controller_disable());
ESP_ERROR_CHECK(esp_bt_controller_deinit());
btStop(); // disable & deinit bt_controller
ESP_LOGI(TAG, "Bluetooth scanner stopped");
} // stop_BLEscan

View File

@ -11,9 +11,9 @@
#define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C
#define DISPLAY_FLIP 1 // rotated display
#define HAS_LED GPIO_NUM_23 // green on board LED (new board ONLY)
#define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL // uses GPIO7 (new board ONLY)
#define BATT_FACTOR 2 // voltage divider 100k/100k on board (new board ONLY)
#define HAS_LED GPIO_NUM_23 // green on board LED (new board ONLY)
#define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL // uses GPIO7
#define BATT_FACTOR 2 // voltage divider 100k/100k on board
// re-define pin definitions of pins_arduino.h
#define PIN_SPI_SS GPIO_NUM_18 // ESP32 GPIO18 (Pin18) -- HPD13A NSS/SEL (Pin4) SPI Chip Select Input

View File

@ -9,10 +9,9 @@
// Local logging tag
static const char TAG[] = "wifi";
static wifi_country_t wifi_country = {.cc = WIFI_MY_COUNTRY,
.schan = WIFI_CHANNEL_MIN,
.nchan = WIFI_CHANNEL_MAX,
.policy = WIFI_COUNTRY_POLICY_MANUAL};
static wifi_country_t wifi_country = {WIFI_MY_COUNTRY, WIFI_CHANNEL_MIN,
WIFI_CHANNEL_MAX, 0,
WIFI_COUNTRY_POLICY_MANUAL};
// globals
uint16_t salt;
@ -106,7 +105,7 @@ void wifi_sniffer_init(void) {
esp_wifi_set_country(&wifi_country)); // set locales for RF and channels
ESP_ERROR_CHECK(
esp_wifi_set_storage(WIFI_STORAGE_RAM)); // we don't need NVRAM
// ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_NULL));
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_NULL));
ESP_ERROR_CHECK(
esp_wifi_set_promiscuous_filter(&filter)); // set MAC frame filter
ESP_ERROR_CHECK(esp_wifi_set_promiscuous_rx_cb(&wifi_sniffer_packet_handler));

View File

@ -5,7 +5,7 @@
// program version - note: increment version after modifications to configData_t
// struct!!
#define PROGVERSION "1.3.82" // use max 10 chars here!
#define PROGVERSION "1.3.83" // use max 10 chars here!
#define PROGNAME "PAXCNT"
//--- Declarations ---

View File

@ -12,7 +12,6 @@
#define BLECOUNTER 1 // comment out if you don't want BLE count, saves power & memory
// BLE scan parameters
#define BLESTACKSIZE 8192 // stack size for esp_bt_controller
#define BLESCANTIME 0 // [seconds] scan duration, 0 means infinite [default], see note below
#define BLESCANWINDOW 80 // [milliseconds] scan window, see below, 3 .. 10240, default 80ms
#define BLESCANINTERVAL 80 // [illiseconds] scan interval, see below, 3 .. 10240, default 80ms = 100% duty cycle
@ -53,7 +52,7 @@
#define RGBLUMINOSITY 30 // 30%
// OLED Display refresh cycle (in Milliseconds)
#define DISPLAYREFRESH_MS 40 // e.g. 40ms -> 1000/40 = 25 frames per second
#define DISPLAYREFRESH_MS 80 // e.g. 40ms -> 1000/40 = 25 frames per second
// LMIC settings
// define hardware independent LMIC settings here, settings of standard library in /lmic/config.h will be ignored