Support 32 bit platforms (ESP32)

This commit is contained in:
Michael Balzer 2023-03-05 08:43:30 +01:00
parent 5686de5daa
commit f70fb1e760
3 changed files with 8 additions and 8 deletions

View file

@ -28,13 +28,13 @@
// 3 = subindex // 3 = subindex
// 4..7 = data (little endian) // 4..7 = data (little endian)
union sdo_buffer { union __attribute__ ((__packed__)) sdo_buffer {
// raw / segment data: // raw / segment data:
UINT8 byte[8]; UINT8 byte[8];
// request / expedited: // request / expedited:
struct { struct __attribute__ ((__packed__)) {
UINT8 control; UINT8 control;
UINT index; UINT index;
UINT8 subindex; UINT8 subindex;

View file

@ -21,11 +21,11 @@
#define OVMS_TWIZY_CFG_BRAKELIGHT 1 #define OVMS_TWIZY_CFG_BRAKELIGHT 1
union cfg_status { union __attribute__ ((__packed__)) cfg_status {
UINT8 drivemode; UINT8 drivemode;
struct { struct __attribute__ ((__packed__)) {
unsigned type:1; // CFG: 0=Twizy80, 1=Twizy45 unsigned type:1; // CFG: 0=Twizy80, 1=Twizy45
unsigned profile_user:2; // CFG: user selected profile: 0=Default, 1..3=Custom unsigned profile_user:2; // CFG: user selected profile: 0=Default, 1..3=Custom
unsigned profile_cfgmode:2; // CFG: profile, cfgmode params were last loaded from unsigned profile_cfgmode:2; // CFG: profile, cfgmode params were last loaded from
@ -43,12 +43,12 @@ extern cfg_status twizy_cfg;
// 1 kept in RAM (working set) // 1 kept in RAM (working set)
// 3 stored in binary EEPROM param slots PARAM_PROFILE1 /2 /3 // 3 stored in binary EEPROM param slots PARAM_PROFILE1 /2 /3
struct cfg_profile { struct __attribute__ ((__packed__)) cfg_profile {
UINT8 checksum; UINT8 checksum;
UINT8 speed, warn; UINT8 speed, warn;
UINT8 torque, power_low, power_high; UINT8 torque, power_low, power_high;
UINT8 drive, neutral, brake; UINT8 drive, neutral, brake;
struct tsmap { struct __attribute__ ((__packed__)) tsmap {
UINT8 spd1, spd2, spd3, spd4; UINT8 spd1, spd2, spd3, spd4;
UINT8 prc1, prc2, prc3, prc4; UINT8 prc1, prc2, prc3, prc4;
} tsmap[3]; // 0=D 1=N 2=B } tsmap[3]; // 0=D 1=N 2=B

View file

@ -22,8 +22,8 @@
// Type shortcuts: // Type shortcuts:
typedef unsigned char UINT8; typedef unsigned char UINT8;
typedef unsigned int UINT; typedef unsigned short UINT;
typedef unsigned int WORD; typedef unsigned short WORD;
typedef unsigned long UINT32; typedef unsigned long UINT32;
typedef signed char INT8; typedef signed char INT8;