Skip to content

Commit

Permalink
Fix mysgw configure script and building RFM69 gw on 64-bit OS (#1552)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
frepkovsky authored Oct 13, 2023
1 parent 8d45e7b commit 27849cb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 12 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion hal/transport/RFM69/driver/new/RFM69_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 27849cb

Please sign in to comment.