Skip to content

Migrate from Arduino ESP32 Core 2.x to 3.x, IDF 5.1 #502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1b11d6e
migrate to new ledc api
brentru Oct 19, 2023
1e0c42a
update copyright, remove todo
brentru Oct 19, 2023
79c0fb4
bump version
brentru Oct 19, 2023
9a58778
hotpatch for arduino-cli failure
brentru Oct 20, 2023
b3e6230
fix format error
brentru Oct 20, 2023
9f0af52
missed two!
brentru Oct 20, 2023
034d7c7
try onewireng instead of standard paul onewire bc its latest
brentru Oct 20, 2023
852ab65
use brentru fork of lvgl
brentru Oct 23, 2023
29ee953
format specifier
brentru Oct 23, 2023
5d9ef80
fix format specifier
brentru Oct 23, 2023
72990fd
brent fork for partition table inc.
brentru Oct 23, 2023
a3910ce
add ws pixels clang
brentru Oct 23, 2023
0eb5df7
add UART BSP3 changes
Nov 9, 2023
eb6838a
Revert
brentru Nov 9, 2023
95df198
add lib
brentru Nov 9, 2023
05794cd
description and use new partition for fh
brentru Nov 13, 2023
41c8f2f
build fh with less strings maybe
brentru Nov 13, 2023
759552a
put back, it's not the file size!
brentru Nov 13, 2023
ede01b4
run CI
brentru Nov 17, 2023
f33af0e
cat neopixel lib
brentru Nov 17, 2023
e2767c4
add debug build for Feather ESP32 v2
brentru Nov 17, 2023
94b3d08
ci-arduino brentru pointer
brentru Nov 17, 2023
aadc9f5
add debug skip
brentru Nov 17, 2023
4c5aac0
fix .test.skip and remove daily (unused?!)
brentru Nov 17, 2023
726868e
check the output from the build script
brentru Nov 17, 2023
c2ae52c
debug generate
brentru Nov 17, 2023
0244ab0
hardcode board name for dev build
brentru Nov 17, 2023
c72f3e8
hardcore board_name for esptool merge bin
brentru Nov 17, 2023
c048afa
put back previous build
brentru Nov 20, 2023
a3f7b59
add debug BUILD
brentru Nov 20, 2023
6d4652d
dev build
brentru Nov 20, 2023
e5672c6
dev build on debug only
brentru Nov 20, 2023
e64bae9
skip arduino boards for debug
brentru Nov 20, 2023
2dfe193
use new rgb builtin macro?
brentru Nov 20, 2023
143b9c7
old macro
brentru Nov 20, 2023
ea31fb2
old macro, re-run with new FQBN
brentru Nov 20, 2023
49025a2
upload to new artifact?
brentru Nov 20, 2023
62c7d1f
change to alpha for pre-release
brentru Nov 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 70 additions & 5 deletions .github/workflows/build-clang-doxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v2
with:
repository: adafruit/ci-arduino
repository: brentru/ci-arduino
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
- name: Install extra Arduino libraries
run: |
git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library
git clone --quiet https://github.com/PaulStoffregen/OneWire.git /home/runner/Arduino/libraries/OneWire
git clone --quiet https://github.com/pstolarz/OneWireNg.git /home/runner/Arduino/libraries/OneWireNg
git clone --quiet https://github.com/adafruit/Adafruit_HX8357_Library.git /home/runner/Arduino/libraries/Adafruit_HX8357_Library
git clone --quiet https://github.com/adafruit/Adafruit_ILI9341.git /home/runner/Arduino/libraries/Adafruit_ILI9341
git clone --quiet https://github.com/adafruit/Adafruit_STMPE610.git /home/runner/Arduino/libraries/Adafruit_STMPE610
git clone --quiet https://github.com/adafruit/Adafruit-ST7735-Library.git /home/runner/Arduino/libraries/Adafruit-ST7735-Library
git clone --quiet https://github.com/adafruit/Adafruit_TouchScreen.git /home/runner/Arduino/libraries/Adafruit_TouchScreen
git clone --depth 1 --branch v8.2.0 https://github.com/lvgl/lvgl.git /home/runner/Arduino/libraries/lvgl
git clone --depth 1 --branch wippersnapper https://github.com/brentru/lvgl.git /home/runner/Arduino/libraries/lvgl
git clone --depth 1 --branch development https://github.com/brentru/Adafruit_LvGL_Glue.git /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library
- name: List all files in Adafruit_LittlevGL_Glue_Library folder
run: |
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v2
with:
repository: adafruit/ci-arduino
repository: brentru/ci-arduino
path: ci
- name: Checkout Board Definitions
uses: actions/checkout@v2
Expand All @@ -110,12 +110,15 @@ jobs:
- name: Install extra Arduino libraries
run: |
git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library
git clone --quiet https://github.com/PaulStoffregen/OneWire.git /home/runner/Arduino/libraries/OneWire
git clone --quiet https://github.com/pstolarz/OneWireNg.git /home/runner/Arduino/libraries/OneWireNg
- name: Install Dependencies
run: |
pip3 install esptool
- name: build ESP32 platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: Check artifacts
run: |
ls examples/Wippersnapper_demo/build/*
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/Wippersnapper_demo/build/*/Wippersnapper_demo.ino.bin wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.bin
Expand Down Expand Up @@ -329,6 +332,68 @@ jobs:
path: |
wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.zip

build-esp32sx-dev:
name: Build WipperSnapper ESP32-Sx DEV BUILDS
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arduino-platform: ["feather_esp32s2_dev", "feather_esp32s2_tft_dev",
"feather_esp32s2_reverse_tft_dev", "feather_esp32s3_dev",
"feather_esp32s3_4mbflash_2mbpsram_dev", "feather_esp32s3_tft_dev",
"feather_esp32s3_reverse_tft_dev"]
steps:
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: actions/checkout@v2
- name: Get WipperSnapper version
run: |
git fetch --prune --unshallow --tags
git describe --dirty --tags
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v2
with:
repository: brentru/ci-arduino
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
- name: Install extra Arduino libraries
run: |
git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library
git clone --quiet https://github.com/pstolarz/OneWireNg.git /home/runner/Arduino/libraries/OneWireNg
git clone --quiet https://github.com/adafruit/Adafruit_HX8357_Library.git /home/runner/Arduino/libraries/Adafruit_HX8357_Library
git clone --quiet https://github.com/adafruit/Adafruit_ILI9341.git /home/runner/Arduino/libraries/Adafruit_ILI9341
git clone --quiet https://github.com/adafruit/Adafruit_STMPE610.git /home/runner/Arduino/libraries/Adafruit_STMPE610
git clone --quiet https://github.com/adafruit/Adafruit-ST7735-Library.git /home/runner/Arduino/libraries/Adafruit-ST7735-Library
git clone --quiet https://github.com/adafruit/Adafruit_TouchScreen.git /home/runner/Arduino/libraries/Adafruit_TouchScreen
git clone --depth 1 --branch wippersnapper https://github.com/brentru/lvgl.git /home/runner/Arduino/libraries/lvgl
git clone --depth 1 --branch development https://github.com/brentru/Adafruit_LvGL_Glue.git /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library
- name: List all files in Adafruit_LittlevGL_Glue_Library folder
run: |
ls /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library
- name: Copy lv_conf.h file in Adafruit_LittlevGL_Glue_Library to the arduino library folder
run: |
cp /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library/lv_conf.h /home/runner/Arduino/libraries
- name: Build for ESP32-SX
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: list
run: |
ls
ls examples/*/build/
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/wippersnapper_debug.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
mv examples/*/build/*/wippersnapper_debug.ino.bin wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.bin
- name: upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-files-dev
path: |
wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.bin



clang_and_doxy:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Pre-compiled binaries and UF2 files for supported hardware are provided on the [

|Platform| MCU(s) |
|--|--|
|[ESP32](https://github.com/espressif/arduino-esp32)| ESP32, ESP32-S2, ESP32-S3, ESP32-C3 |
|[ESP32-x](https://github.com/espressif/arduino-esp32)| ESP32, ESP32-S2, ESP32-S3, ESP32-C3 |
|[ESP8266](https://github.com/esp8266/Arduino)| ESP8266 |
|[RP2040](https://github.com/earlephilhower/arduino-pico)| RP2040 MCU w/WiFi (i.e: Pico W) |
|[ATSAMD](https://github.com/adafruit/ArduinoCore-samd/)| SAMD51 MCU w/separate WiFi Co-Processor (i.e: Adafruit "AirLift")|
Expand Down
Binary file modified examples/Wippersnapper_NoFS/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions examples/Wippersnapper_NoFS/.feather_esp32s2_dev.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/Wippersnapper_NoFS/.feather_esp32s3_dev.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/Wippersnapper_demo/.feather_esp32s2_dev.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/Wippersnapper_demo/.feather_esp32s3_dev.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp32.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp32_v2.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp32s2.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp32s2_dev.generate
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp32s3.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp32s3_dev.generate
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp8266.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_s2_tinyusb.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions examples/wippersnapper_debug/.funhouse.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.magtag.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.metroesp32s2.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.mkrwifi1010.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.nano_33_iot.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions examples/wippersnapper_debug/.pyportal_tinyusb.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@



1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.qtpy_esp32.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.qtpy_esp32c3.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.qtpy_esp32s2.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.qtpy_esp32s3.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.qtpy_esp32s3_n4r2.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

24 changes: 24 additions & 0 deletions examples/wippersnapper_debug/wippersnapper_debug.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Adafruit IO WipperSnapper Beta (DEBUG BUILD ONLY!)
// Brent Rubell for Adafruit Industries, 2021 - 2023

#include "Wippersnapper_Networking.h"
Wippersnapper_WiFi wipper;

// Enable debug output for beta builds
#define WS_DEBUG

void setup() {
// Provisioning must occur prior to serial init.
wipper.provision();

Serial.begin(115200); // wippersnapper serial
Serial1.begin(115200); // ESP-IDF messages serial
Serial1.setDebugOutput(true); // Enable ESP-IDF messages over Serial1
//while (!Serial) delay(10);

wipper.connect();
}

void loop() {
wipper.run();
}
6 changes: 3 additions & 3 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=Adafruit WipperSnapper
version=1.0.0-beta.73
version=1.0.0-alpha.74
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Arduino client for Adafruit.io WipperSnapper
paragraph=Arduino client for Adafruit.io WipperSnapper
sentence=Arduino application for Adafruit.io WipperSnapper
paragraph=Arduino application for Adafruit.io WipperSnapper
category=Communication
url=https://github.com/adafruit/Adafruit_IO_Arduino
architectures=*
Expand Down
2 changes: 1 addition & 1 deletion src/Wippersnapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) {

#ifdef USE_DISPLAY
char buffer[100];
snprintf(buffer, 100, "[PWM] Writing %u Hz to pin %s\n.",
snprintf(buffer, 100, "[PWM] Writing %ld Hz to pin %s\n.",
msgPWMWriteFreqRequest.frequency, msgPWMWriteFreqRequest.pin);
WS._ui_helper->add_text_to_terminal(buffer);
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/Wippersnapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* Copyright (c) Brent Rubell 2020-2022 for Adafruit Industries.
* Copyright (c) Brent Rubell 2020-2023 for Adafruit Industries.
*
* BSD license, all text here must be included in any redistribution.
*
Expand Down Expand Up @@ -71,7 +71,7 @@
#endif

#define WS_VERSION \
"1.0.0-beta.73" ///< WipperSnapper app. version (semver-formatted)
"1.0.0-alpha.74" ///< WipperSnapper app. version (semver-formatted)

// Reserved Adafruit IO MQTT topics
#define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic
Expand Down
55 changes: 30 additions & 25 deletions src/components/i2c/WipperSnapper_I2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,65 +816,70 @@ void WipperSnapper_Component_I2C::displayDeviceEventMessage(
msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].type) {
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE:
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f *C\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f *C\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE_FAHRENHEIT:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE_FAHRENHEIT:
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f *F\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f *F\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RELATIVE_HUMIDITY:
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f %% rh\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f %% rh\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PRESSURE:
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f hPA\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f hPA\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ALTITUDE:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f m\n", sensorAddress, value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f m\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_LIGHT:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f lux\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f lux\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM10_STD:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM25_STD:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM100_STD:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CO2:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ECO2:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f ppm\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f ppm\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_TVOC:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f ppb\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f ppb\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_UNITLESS_PERCENT:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f%%\n", sensorAddress, value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f%%\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOLTAGE:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f V\n", sensorAddress, value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f V\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CURRENT:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f mA\n", sensorAddress, value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f mA\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RAW:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PROXIMITY:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f\n", sensorAddress, value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_GAS_RESISTANCE:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f Ohms\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f Ohms\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_NOX_INDEX:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f NOX\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f NOX\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOC_INDEX:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f VOC\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f VOC\n",
(unsigned int)sensorAddress, value);
break;
default:
break;
Expand Down
Loading