Fix mysgw configure script and building RFM69 gw on 64-bit OS (#1552)

* Fix configure script errors on 64-bit OS (#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 (#1551)

Force data type for the parameter of min() function to avoid conflicts
This commit is contained in:
Frantisek Repkovsky
2023-10-13 20:52:35 +02:00
committed by GitHub
parent 8d45e7bad7
commit 27849cbc88
2 changed files with 14 additions and 4 deletions

15
configure vendored
View File

@@ -258,6 +258,7 @@ function detect_machine {
function gcc_cpu_flags {
local soc=$1
local cpu=$2
case $soc in
BCM2835)
flags="-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard"
@@ -266,10 +267,18 @@ function gcc_cpu_flags {
flags="-march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard"
;;
BCM2837)
flags="-march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard"
if [[ ${cpu} == "aarch64" ]]; then
flags="-march=armv8-a+crc -mtune=cortex-a53"
else
flags="-march=armv8-a+crc -mtune=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard"
fi
;;
BCM2711)
flags="-march=armv8-a+crc -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard"
if [[ ${cpu} == "aarch64" ]]; then
flags="-march=armv8-a+crc -mtune=cortex-a72"
else
flags="-march=armv8-a+crc -mtune=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard"
fi
;;
AM33XX)
flags="-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard"
@@ -573,7 +582,7 @@ if [ -z "${SOC}" ]; then
fi
if [ -z "${CPUFLAGS}" ]; then
CPUFLAGS=$(gcc_cpu_flags $SOC)
CPUFLAGS=$(gcc_cpu_flags "${SOC}" "${CPU}")
fi
if [[ $SOC == "BCM2835" || $SOC == "BCM2836" || $SOC == "BCM2837" || $SOC == "BCM2711" ]]; then

View File

@@ -278,7 +278,8 @@ LOCAL void RFM69_interruptHandling(void)
RFM69.currentPacket.header.packetLen - 1);
if (RFM69.currentPacket.header.version >= RFM69_MIN_PACKET_HEADER_VERSION) {
RFM69.currentPacket.payloadLen = min(RFM69.currentPacket.header.packetLen - (RFM69_HEADER_LEN - 1),
RFM69.currentPacket.payloadLen = min(static_cast<uint>
(RFM69.currentPacket.header.packetLen - (RFM69_HEADER_LEN - 1)),
RFM69_MAX_PACKET_LEN);
RFM69.ackReceived = RFM69_getACKReceived(RFM69.currentPacket.header.controlFlags);
RFM69.dataReceived = !RFM69.ackReceived;