Skip to content

invalid conversion from 'uint16_t' to 'SerialConfig' #14

Open
@mostafahk

Description

@mostafahk

In last update of ESP8266 SDK, I got many errors:

.pio\libdeps\esp12e\ArduinoRS485\src\RS485.cpp:65:28: error: invalid conversion from 'uint16_t' {aka 'short unsigned int'} to 'SerialConfig' [-fpermissive]

error occurs in _serial->begin call.

I solved problem with following changes:

In RS485.h:

#ifdef __AVR__
#define RS485_DEFAULT_DE_PIN 2
#define RS485_DEFAULT_RE_PIN -1
#elif defined(ESP32) || defined(ESP8266)
#define RS485_DEFAULT_DE_PIN 0
#define RS485_DEFAULT_RE_PIN 0
#else
#define RS485_DEFAULT_DE_PIN A6
#define RS485_DEFAULT_RE_PIN A5
#endif

#if defined(ESP32) || defined(ESP8266)
#define RS485_SER_CONF_TYPE SerialConfig
#else
#define RS485_SER_CONF_TYPE uint16_t
#endif
....

class RS485Class{
....
RS485_SER_CONF_TYPE _config;
...
}

In RS485.cpp:

_serial->begin(baudrate, (RS485_SER_CONF_TYPE)config);

Activity

mostafahk

mostafahk commented on Aug 30, 2021

@mostafahk
Author

I've made my change in a fork and my pull request is here.

kscholty

kscholty commented on Nov 15, 2021

@kscholty

Could someone please merge the according PR?
This ssue makes it impossible to use the lib on ESP MCs. The ESP32's SERIAL_8N1 config value is a 32 bit value (0x800001C)

linked a pull request that will close this issueESP8266 ESP32 compatible #16on Jan 14, 2023
rseidt

rseidt commented on Apr 3, 2024

@rseidt

I stumbled upon this problem, and (once again) fixed that issue, because the mentined PR #16 seem abononed (last commit 2 years ago). Please find an updated PR here: Added Compatibility to ESP32 and ESP8266 #53

linked a pull request that will close this issue on Apr 3, 2024
linked a pull request that will close this issueAdded Compatibility to ESP32 and ESP8266 #53on Apr 12, 2024
mattl1598

mattl1598 commented on Apr 23, 2024

@mattl1598

is this going to be approved soon? would be nice to use a proper release version of the library and keep it updated through the arduino ide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: enhancementProposed improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @per1234@mostafahk@mattl1598@rseidt@kscholty

      Issue actions

        invalid conversion from 'uint16_t' to 'SerialConfig' · Issue #14 · arduino-libraries/ArduinoRS485