Skip to content

Commit 0cf718f

Browse files
committed
fix STM32 compile error
1 parent b9dc5f1 commit 0cf718f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/madflight/gps/GPS-uBlox/qqqlab_GPS_UBLOX.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,8 @@ void AP_GPS_UBLOX::log_rxm_raw(const struct ubx_rxm_raw &raw)
831831
};
832832
AP::logger().WriteBlock(&pkt, sizeof(pkt));
833833
}
834+
#else
835+
(void)raw;
834836
#endif
835837
}
836838

@@ -873,6 +875,8 @@ void AP_GPS_UBLOX::log_rxm_rawx(const struct ubx_rxm_rawx &raw)
873875
};
874876
AP::logger().WriteBlock(&pkt, sizeof(pkt));
875877
}
878+
#else
879+
(void)raw;
876880
#endif
877881
}
878882
#endif // UBLOX_RXM_RAW_LOGGING
@@ -2043,6 +2047,7 @@ void AP_GPS_UBLOX::Write_AP_Logger_Log_Startup_messages() const
20432047
void AP_GPS_UBLOX::_check_new_itow(uint32_t itow)
20442048
{
20452049
//TODO check_new_itow(itow, _payload_length + sizeof(ubx_header) + 2);
2050+
(void)itow;
20462051
}
20472052

20482053
// support for retrieving RTCMv3 data from a moving baseline base
@@ -2053,6 +2058,9 @@ bool AP_GPS_UBLOX::get_RTCMV3(const uint8_t *&bytes, uint16_t &len)
20532058
len = rtcm3_parser->get_len(bytes);
20542059
return len > 0;
20552060
}
2061+
#else
2062+
(void)bytes;
2063+
(void)len;
20562064
#endif
20572065
return false;
20582066
}

src/madflight/hal/STM32/hal_STM32.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ int hal_get_pin_number(String s) {
215215
//pin names like PB3, PC13
216216
if(s.length() < 3) return -1;
217217
if(s[0] != 'P') return -1;
218-
if(port<'A' || port > 'H') return -1;
218+
if(s[1]<'A' || s[1] > 'H') return -1;
219219
int port = s[1] - 'A';
220-
int pin = s.substring(s,2).toInt();
220+
int pin = s.substring(2).toInt();
221221
if(pin<0 || pin>15) return -1;
222-
return port*16 + pin;
222+
return port * 16 + pin;
223223
}

0 commit comments

Comments
 (0)