This commit is contained in:
Klaus K Wilting 2018-06-03 13:23:03 +02:00
parent 1c372bae5e
commit c61b4d1d53
2 changed files with 18 additions and 5 deletions

View File

@ -11,10 +11,10 @@
; ---> SELECT TARGET PLATFORM HERE! <--- ; ---> SELECT TARGET PLATFORM HERE! <---
[platformio] [platformio]
env_default = heltec ;env_default = heltec
;env_default = ttgov1 ;env_default = ttgov1
;env_default = ttgov2 ;env_default = ttgov2
;env_default = ttgov21 env_default = ttgov21
;env_default = lopy ;env_default = lopy
;env_default = lopy4 ;env_default = lopy4
;env_default = fipy ;env_default = fipy
@ -27,7 +27,6 @@ description = Paxcounter is a proof-of-concept ESP32 device for metering passeng
platform_espressif32 = espressif32@>=1.0.1 platform_espressif32 = espressif32@>=1.0.1
board_build.partitions = no_ota.csv board_build.partitions = no_ota.csv
board_upload.maximum_size = 2097152 board_upload.maximum_size = 2097152
monitor_speed = 115200
lib_deps_display = lib_deps_display =
U8g2@>=2.22.14 U8g2@>=2.22.14
lib_deps_rgbled = lib_deps_rgbled =
@ -52,6 +51,8 @@ framework = arduino
board = heltec_wifi_lora_32 board = heltec_wifi_lora_32
board_build.partitions = ${common_env_data.board_build.partitions} board_build.partitions = ${common_env_data.board_build.partitions}
board_upload.maximum_size = ${common_env_data.board_upload.maximum_size} board_upload.maximum_size = ${common_env_data.board_upload.maximum_size}
monitor_speed = 115200
upload_speed = 115200
lib_deps = lib_deps =
${common_env_data.lib_deps_display} ${common_env_data.lib_deps_display}
build_flags = build_flags =
@ -64,6 +65,7 @@ framework = arduino
board = esp32dev board = esp32dev
board_build.partitions = ${common_env_data.board_build.partitions} board_build.partitions = ${common_env_data.board_build.partitions}
board_upload.maximum_size = ${common_env_data.board_upload.maximum_size} board_upload.maximum_size = ${common_env_data.board_upload.maximum_size}
monitor_speed = 115200
upload_speed = 115200 upload_speed = 115200
lib_deps = lib_deps =
${common_env_data.lib_deps_display} ${common_env_data.lib_deps_display}
@ -77,6 +79,7 @@ framework = arduino
board = esp32dev board = esp32dev
board_build.partitions = ${common_env_data.board_build.partitions} board_build.partitions = ${common_env_data.board_build.partitions}
board_upload.maximum_size = ${common_env_data.board_upload.maximum_size} board_upload.maximum_size = ${common_env_data.board_upload.maximum_size}
monitor_speed = 115200
upload_speed = 921600 upload_speed = 921600
lib_deps = lib_deps =
${common_env_data.lib_deps_display} ${common_env_data.lib_deps_display}
@ -90,6 +93,7 @@ framework = arduino
board = esp32dev board = esp32dev
board_build.partitions = ${common_env_data.board_build.partitions} board_build.partitions = ${common_env_data.board_build.partitions}
board_upload.maximum_size = ${common_env_data.board_upload.maximum_size} board_upload.maximum_size = ${common_env_data.board_upload.maximum_size}
monitor_speed = 115200
upload_speed = 921600 upload_speed = 921600
lib_deps = lib_deps =
${common_env_data.lib_deps_display} ${common_env_data.lib_deps_display}
@ -103,6 +107,7 @@ framework = arduino
board = esp32dev board = esp32dev
board_build.partitions = ${common_env_data.board_build.partitions} board_build.partitions = ${common_env_data.board_build.partitions}
board_upload.maximum_size = ${common_env_data.board_upload.maximum_size} board_upload.maximum_size = ${common_env_data.board_upload.maximum_size}
monitor_speed = 115200
upload_speed = 921600 upload_speed = 921600
lib_deps = lib_deps =
${common_env_data.lib_deps_rgbled} ${common_env_data.lib_deps_rgbled}
@ -116,6 +121,7 @@ framework = arduino
board = esp32dev board = esp32dev
board_build.partitions = ${common_env_data.board_build.partitions} board_build.partitions = ${common_env_data.board_build.partitions}
board_upload.maximum_size = ${common_env_data.board_upload.maximum_size} board_upload.maximum_size = ${common_env_data.board_upload.maximum_size}
monitor_speed = 115200
upload_speed = 921600 upload_speed = 921600
lib_deps = lib_deps =
${common_env_data.lib_deps_rgbled} ${common_env_data.lib_deps_rgbled}
@ -129,6 +135,7 @@ framework = arduino
board = esp32dev board = esp32dev
board_build.partitions = ${common_env_data.board_build.partitions} board_build.partitions = ${common_env_data.board_build.partitions}
board_upload.maximum_size = ${common_env_data.board_upload.maximum_size} board_upload.maximum_size = ${common_env_data.board_upload.maximum_size}
monitor_speed = 115200
upload_speed = 921600 upload_speed = 921600
lib_deps = lib_deps =
${common_env_data.lib_deps_rgbled} ${common_env_data.lib_deps_rgbled}
@ -142,6 +149,7 @@ framework = arduino
board = lolin32 board = lolin32
board_build.partitions = ${common_env_data.board_build.partitions} board_build.partitions = ${common_env_data.board_build.partitions}
board_upload.maximum_size = ${common_env_data.board_upload.maximum_size} board_upload.maximum_size = ${common_env_data.board_upload.maximum_size}
monitor_speed = 115200
upload_speed = 256000 upload_speed = 256000
lib_deps = lib_deps =
${common_env_data.lib_deps_rgbled} ${common_env_data.lib_deps_rgbled}
@ -155,6 +163,7 @@ framework = arduino
board = lolin32 board = lolin32
board_build.partitions = ${common_env_data.board_build.partitions} board_build.partitions = ${common_env_data.board_build.partitions}
board_upload.maximum_size = ${common_env_data.board_upload.maximum_size} board_upload.maximum_size = ${common_env_data.board_upload.maximum_size}
monitor_speed = 115200
upload_speed = 921600 upload_speed = 921600
lib_deps = lib_deps =
${common_env_data.lib_deps_rgbled} ${common_env_data.lib_deps_rgbled}

View File

@ -55,9 +55,13 @@ uint16_t read_voltage(void)
//Check if Two Point or Vref are burned into eFuse //Check if Two Point or Vref are burned into eFuse
check_efuse(); check_efuse();
//Configure GPIO used fpr ADC1
gpio_set_direction(GPIO_NUM_35, GPIO_MODE_INPUT);
//Configure ADC1 //Configure ADC1
adc1_config_width(ADC_WIDTH_BIT_12); ESP_ERROR_CHECK(adc_gpio_init(unit, (adc_channel_t) channel));
adc1_config_channel_atten(channel, atten); ESP_ERROR_CHECK(adc1_config_width(ADC_WIDTH_BIT_12));
ESP_ERROR_CHECK(adc1_config_channel_atten(channel, atten));
//Characterize ADC1 //Characterize ADC1
esp_adc_cal_characteristics_t *adc_chars = (esp_adc_cal_characteristics_t *) calloc(1, sizeof(esp_adc_cal_characteristics_t)); esp_adc_cal_characteristics_t *adc_chars = (esp_adc_cal_characteristics_t *) calloc(1, sizeof(esp_adc_cal_characteristics_t));