Browse Source

Merge pull request #175 from klahus1/development_klahus1

fix alignment
pull/179/head
lumapu 2 years ago
committed by GitHub
parent
commit
057032ecb6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      tools/esp8266/defines.h

12
tools/esp8266/defines.h

@ -109,15 +109,16 @@ typedef enum { // ToDo: to be verified by field tests
#define SER_DEBUG_LEN 1 // uint8_t
#define SER_INTERVAL_LEN 2 // uint16_t
#pragma pack(push) // push current alignment to stack
#pragma pack(1) // set alignment to 1 byte boundary
typedef struct {
char broker[MQTT_ADDR_LEN];
uint16_t port;
char user[MQTT_USER_LEN];
char pwd[MQTT_PWD_LEN];
char topic[MQTT_TOPIC_LEN];
} mqttConfig_t;
} /*__attribute__((__packed__))*/ mqttConfig_t;
#pragma pack(pop) // restore original alignment from stack
typedef struct {
char deviceName[DEVNAME_LEN];
@ -126,6 +127,8 @@ typedef struct {
char stationPwd[PWD_LEN];
} sysConfig_t;
#pragma pack(push) // push current alignment to stack
#pragma pack(1) // set alignment to 1 byte boundary
typedef struct {
// nrf24
uint16_t sendInterval;
@ -146,7 +149,8 @@ typedef struct {
uint16_t serialInterval;
bool serialShowIv;
bool serialDebug;
} config_t;
} /*__attribute__((__packed__))*/ config_t;
#pragma pack(pop) // restore original alignment from stack
#define CFG_MQTT_LEN MQTT_ADDR_LEN + 2 + MQTT_USER_LEN + MQTT_PWD_LEN +MQTT_TOPIC_LEN

Loading…
Cancel
Save