mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-14 12:48:31 -04:00
HAL_ChibiOS: fixed substitution of %BOARD%-BL
This commit is contained in:
parent
c44a8309f9
commit
963675689c
@ -216,13 +216,13 @@ static void string_substitute(const char *str, char *str2)
|
|||||||
while (*str) {
|
while (*str) {
|
||||||
char c = *str;
|
char c = *str;
|
||||||
if (c == '%') {
|
if (c == '%') {
|
||||||
if (strcmp(str, "%BOARD%") == 0) {
|
if (strncmp(str, "%BOARD%", 7) == 0) {
|
||||||
memcpy(p, HAL_BOARD_NAME, strlen(HAL_BOARD_NAME));
|
memcpy(p, HAL_BOARD_NAME, strlen(HAL_BOARD_NAME));
|
||||||
str += 7;
|
str += 7;
|
||||||
p += strlen(HAL_BOARD_NAME);
|
p += strlen(HAL_BOARD_NAME);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strcmp(str, "%SERIAL%") == 0) {
|
if (strncmp(str, "%SERIAL%", 8) == 0) {
|
||||||
const char *hex = "0123456789ABCDEF";
|
const char *hex = "0123456789ABCDEF";
|
||||||
const uint8_t *cpu_id = (const uint8_t *)UDID_START;
|
const uint8_t *cpu_id = (const uint8_t *)UDID_START;
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
Loading…
Reference in New Issue
Block a user