jcomas / S8_UART

SenseAir S8 CO2 sensor library for serial communication (UART)
MIT License
24 stars 5 forks source link

[feature request] support for Arduino framework on Atmelavr #1

Closed hpsaturn closed 2 years ago

hpsaturn commented 2 years ago

Summary

Testing the library over old Arduino shield, I have the next compiling issue:

Indexing .pio/build/arduino/lib007/libSensirion Core.a
Compiling .pio/build/arduino/lib30a/S8_UART/modbus_crc.cpp.o
Compiling .pio/build/arduino/lib30a/S8_UART/s8_uart.cpp.o
.pio/libdeps/arduino/S8_UART/src/modbus_crc.cpp:45:1: error: narrowing conversion of '192' from 'int' to 'char' inside { } [-Wnarrowing]
 };
 ^
.pio/libdeps/arduino/S8_UART/src/modbus_crc.cpp:45:1: error: narrowing conversion of '193' from 'int' to 'char' inside { } [-Wnarrowing]
.pio/libdeps/arduino/S8_UART/src/modbus_crc.cpp:45:1: error: narrowing conversion of '195' from 'int' to 'char' inside { } [-Wnarrowing]
.pio/libdeps/arduino/S8_UART/src/modbus_crc.cpp:45:1: error: narrowing conversion of '194' from 'int' to 'char' inside { } [-Wnarrowing]

Environment

With the next PlatformIO config:

[arduino_avr]
platform = atmelavr
board = pro16MHzatmega328
framework = arduino
monitor_speed = ${env.monitor_speed}
build_flags =
  ${env.build_flags}
lib_deps =
  ${env.lib_deps}

Tested in the next branch of CanAirIO Sensorslib

jcomas commented 2 years ago

Added support for Atmel AVR, updated to portable types. It needs testing with S8 sensor.

hpsaturn commented 2 years ago

Thanks @jcomas