Fix compilation with Arduino 3 alpha 1 (#19690)

This commit is contained in:
s-hadinger 2023-10-06 21:00:42 +02:00 committed by GitHub
parent bf9c5b86c6
commit 72b2767a74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,8 +6,7 @@
* 2 wire communication - I2C
*******************************************************************/
#include "be_constobj.h"
#include "esp32-hal.h"
#include "esp_idf_version.h"
extern int b_serial_init(bvm *vm);
extern int b_serial_deinit(bvm *vm);
@ -17,6 +16,40 @@ extern int b_serial_read(bvm *vm);
extern int b_serial_available(bvm *vm);
extern int b_serial_flush(bvm *vm);
#if ESP_IDF_VERSION_MAJOR < 5
#include "esp32-hal.h"
#else
// it should be #include "HardwareSerial.h"
// but the C++ header cannot be included in a C file
// so there's a copy below
enum SerialConfig {
SERIAL_5N1 = 0x8000010,
SERIAL_6N1 = 0x8000014,
SERIAL_7N1 = 0x8000018,
SERIAL_8N1 = 0x800001c,
SERIAL_5N2 = 0x8000030,
SERIAL_6N2 = 0x8000034,
SERIAL_7N2 = 0x8000038,
SERIAL_8N2 = 0x800003c,
SERIAL_5E1 = 0x8000012,
SERIAL_6E1 = 0x8000016,
SERIAL_7E1 = 0x800001a,
SERIAL_8E1 = 0x800001e,
SERIAL_5E2 = 0x8000032,
SERIAL_6E2 = 0x8000036,
SERIAL_7E2 = 0x800003a,
SERIAL_8E2 = 0x800003e,
SERIAL_5O1 = 0x8000013,
SERIAL_6O1 = 0x8000017,
SERIAL_7O1 = 0x800001b,
SERIAL_8O1 = 0x800001f,
SERIAL_5O2 = 0x8000033,
SERIAL_6O2 = 0x8000037,
SERIAL_7O2 = 0x800003b,
SERIAL_8O2 = 0x800003f
};
#endif
#include "be_fixed_be_class_serial.h"
/* @const_object_info_begin