Skip to content

Commit 97afb83

Browse files
committed
Fix compiler warnings
1 parent 194ddf5 commit 97afb83

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

arduino-altherma-controller/03-P1P2.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static errorbuf_t EB[RB_SIZE];
1010
/**************************************************************************/
1111
void recvBus() {
1212
while (P1P2Serial.packetavailable()) {
13-
uint16_t delta;
13+
uint16_t delta = 0;
1414
errorbuf_t readError = 0;
1515
uint16_t nread = P1P2Serial.readpacket(RB, delta, EB, RB_SIZE, CRC_GEN, CRC_FEED);
1616
if (nread > RB_SIZE) {
@@ -192,7 +192,7 @@ void processWrite(uint16_t n) {
192192

193193
// Write command from queue
194194
if (cmdLen && RB[2] == cmdType) { // second byte in queue is packet type, compare to received packet type
195-
if (2 + cmdLen <= n) { // check if param size in queue is not larger than space available in packet
195+
if ((cmdLen + 2U) <= n) { // check if param size in queue is not larger than space available in packet
196196
if (data.eepromDaikin.today < data.config.writeQuota) {
197197
for (byte i = 0; i < cmdLen; i++) {
198198
WB[i + 2] = cmdQueue[i + 1]; // skip the first byte in the queue (cmdLen)
@@ -228,7 +228,7 @@ void processWrite(uint16_t n) {
228228
WB[0] = 0x00;
229229
WB[1] = 0x00;
230230
n = cmdLen + 2;
231-
if (2 + cmdLen <= sizeof(WB)) { // check if size in queue is not larger than space available in packet
231+
if (n <= sizeof(WB)) { // check if size in queue is not larger than space available in packet
232232
for (byte i = 0; i < (cmdLen - 1); i++) {
233233
WB[i + 2] = cmdQueue[i + 1]; // skip the first byte in the queue (cmdLen)
234234
}

arduino-altherma-controller/advanced_settings.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
// #define ENABLE_DHCP // Enable DHCP (Auto IP settings), consumes a lot of FLASH memory
1010

11+
#if defined(ARDUINO_AVR_MEGA) || defined(ARDUINO_AVR_MEGA2560)
12+
#define ENABLE_EXTENDED_WEBUI
13+
#define ENABLE_DHCP
14+
#endif
1115

1216
/****** DEFAULT CONFIGURATION ******/
1317
/*

arduino-altherma-controller/arduino-altherma-controller.ino

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
v3.0 2024-02-02 Function comments. Remove "Disabled" Controller mode (only Manual; Auto),
1212
improved automatic connection to the P1P2 bus, connect to any peripheral address
1313
between 0xF0 to 0xFF (depends on Altherma model), show other controllers and available addresses.
14-
v4.0 2025-XX-XX CSS improvement, code optimization (with some help from ChatGPT), simplify P1P2 Status page,
14+
v4.0 2025-03-09 CSS improvement, code optimization (with some help from ChatGPT), simplify P1P2 Status page,
1515
target temp. hysteresis in decimals, fix 404 error page, bugfix 0x30 packet,
1616
more virtual outputs in Loxone Config, rename some inputs in Loxone Config
1717
*/
@@ -33,7 +33,6 @@ const byte VERSION[] = { 4, 0 };
3333
#include <avr/wdt.h>
3434
#include <util/atomic.h>
3535

36-
3736
enum first_last_t : byte {
3837
FIRST,
3938
LAST
@@ -57,6 +56,8 @@ enum data_packets_t : byte {
5756
DATA_ONLY_CHANGE // Only If Payload Changed
5857
};
5958

59+
#include "advanced_settings.h"
60+
6061
typedef struct {
6162
byte ip[4];
6263
byte subnet[4];
@@ -79,8 +80,6 @@ typedef struct {
7980
byte packetStatus[PACKET_LAST][256 / 8];
8081
} config_t;
8182

82-
#include "advanced_settings.h"
83-
8483
// default values for the web UI
8584
const config_t DEFAULT_CONFIG = {
8685
DEFAULT_STATIC_IP,

0 commit comments

Comments
 (0)