Skip to content

Commit 27849cb

Browse files
authored
Fix mysgw configure script and building RFM69 gw on 64-bit OS (mysensors#1552)
* Fix configure script errors on 64-bit OS (mysensors#1550) Use only gcc flags relevant to aarch64 for 64-bit RPI SoCs on 64-bit OS version * Fix mysgw build errors on 64-bit OS (mysensors#1551) Force data type for the parameter of min() function to avoid conflicts
1 parent 8d45e7b commit 27849cb

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

configure

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ function detect_machine {
258258

259259
function gcc_cpu_flags {
260260
local soc=$1
261+
local cpu=$2
261262
case $soc in
262263
BCM2835)
263264
flags="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard"
@@ -266,10 +267,18 @@ function gcc_cpu_flags {
266267
flags="-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard"
267268
;;
268269
BCM2837)
269-
flags="-march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard"
270+
if [[ ${cpu} == "aarch64" ]]; then
271+
flags="-march=armv8-a+crc -mtune=cortex-a53"
272+
else
273+
flags="-march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard"
274+
fi
270275
;;
271276
BCM2711)
272-
flags="-march=armv8-a+crc -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard"
277+
if [[ ${cpu} == "aarch64" ]]; then
278+
flags="-march=armv8-a+crc -mtune=cortex-a72"
279+
else
280+
flags="-march=armv8-a+crc -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard"
281+
fi
273282
;;
274283
AM33XX)
275284
flags="-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard"
@@ -573,7 +582,7 @@ if [ -z "${SOC}" ]; then
573582
fi
574583

575584
if [ -z "${CPUFLAGS}" ]; then
576-
CPUFLAGS=$(gcc_cpu_flags $SOC)
585+
CPUFLAGS=$(gcc_cpu_flags "${SOC}" "${CPU}")
577586
fi
578587

579588
if [[ $SOC == "BCM2835" || $SOC == "BCM2836" || $SOC == "BCM2837" || $SOC == "BCM2711" ]]; then

hal/transport/RFM69/driver/new/RFM69_new.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ LOCAL void RFM69_interruptHandling(void)
278278
RFM69.currentPacket.header.packetLen - 1);
279279

280280
if (RFM69.currentPacket.header.version >= RFM69_MIN_PACKET_HEADER_VERSION) {
281-
RFM69.currentPacket.payloadLen = min(RFM69.currentPacket.header.packetLen - (RFM69_HEADER_LEN - 1),
281+
RFM69.currentPacket.payloadLen = min(static_cast<uint>
282+
(RFM69.currentPacket.header.packetLen - (RFM69_HEADER_LEN - 1)),
282283
RFM69_MAX_PACKET_LEN);
283284
RFM69.ackReceived = RFM69_getACKReceived(RFM69.currentPacket.header.controlFlags);
284285
RFM69.dataReceived = !RFM69.ackReceived;

0 commit comments

Comments
 (0)