Skip to content

Commit f731e27

Browse files
authored
Allow Fedora to update ChibiOS configs. (#18698)
1 parent 81988cc commit f731e27

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

platforms/chibios/boards/GENERIC_STM32_F401XC/configs/mcuconf.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
#define STM32_PLLP_VALUE 4
5454
#define STM32_PLLQ_VALUE 7
5555
#define STM32_HPRE STM32_HPRE_DIV1
56-
#define STM32_PPRE1 STM32_PPRE1_DIV2
57-
#define STM32_PPRE2 STM32_PPRE2_DIV1
56+
#define STM32_PPRE1 STM32_PPRE1_DIV2
57+
#define STM32_PPRE2 STM32_PPRE2_DIV1
5858
#define STM32_RTCSEL STM32_RTCSEL_LSI
5959
#define STM32_RTCPRE_VALUE 8
6060
#define STM32_MCO1SEL STM32_MCO1SEL_HSI

platforms/chibios/boards/STEMCELL/configs/mcuconf.h

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
// Copyright 2022 Mega Mind (@megamind4089)
2-
// SPDX-License-Identifier: GPL-2.0-or-later
1+
/*
2+
ChibiOS - Copyright (C) 2006..2020 Giovanni Di Sirio
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
316

417
#ifndef MCUCONF_H
518
#define MCUCONF_H
@@ -165,6 +178,14 @@
165178
#define STM32_PWM_USE_TIM10 FALSE
166179
#define STM32_PWM_USE_TIM11 FALSE
167180

181+
/*
182+
* RTC driver system settings.
183+
*/
184+
#define STM32_RTC_PRESA_VALUE 32
185+
#define STM32_RTC_PRESS_VALUE 1024
186+
#define STM32_RTC_CR_INIT 0
187+
#define STM32_RTC_TAMPCR_INIT 0
188+
168189
/*
169190
* SERIAL driver system settings.
170191
*/

util/chibios_conf_updater.sh

+8-4
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ umask 022
1212
# wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
1313
# sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
1414
# sudo apt-get update && sudo apt-get install adoptopenjdk-8-hotspot
15-
15+
#
16+
# For Fedora 36-ish distros:
17+
# # Prep yum repository from https://adoptium.net/installation/linux/
18+
# sudo dnf install -y ant temurin-8-jdk
19+
# export JAVA_HOME=/usr/lib/jvm/temurin-8-jdk
1620

1721
sinfo() { echo "$@" >&2 ; }
1822
shead() { sinfo "" ; sinfo "---------------------------------" ; sinfo "-- $@" ; sinfo "---------------------------------" ; }
19-
havecmd() { command command type "${1}" >/dev/null 2>&1 || return 1 ; }
2023

2124
this_script="$(realpath "${BASH_SOURCE[0]}")"
2225
script_dir="$(realpath "$(dirname "$this_script")")"
@@ -31,7 +34,7 @@ build_fmpp() {
3134
|| { mkdir "$script_dir/fmpp" && tar xf "$script_dir/fmpp.tar.gz" -C "$script_dir/fmpp" --strip-components=1 ; }
3235
pushd "$script_dir/fmpp" >/dev/null 2>&1
3336
sed -e "s#bootclasspath.path=.*#bootclasspath.path=$(find /usr/lib/jvm -name 'rt.jar' | sort | tail -n1)#g" \
34-
-e "s#ant.jar.path=.*#ant.jar.path=$(find /usr/share/java -name 'ant-1*.jar' | sort | tail -n1)#g" \
37+
-e "s#ant.jar.path=.*#ant.jar.path=$(find /usr/share/java -name 'ant-1*.jar' -or -name 'ant.jar' | sort | tail -n1)#g" \
3538
build.properties.sample > build.properties
3639
sed -e 's#source="1.5"#source="1.8"#g' \
3740
-e 's#target="1.5"#target="1.8"#g' \
@@ -98,7 +101,8 @@ upgrade_mcuconf_files() {
98101
popd >/dev/null 2>&1
99102
}
100103

101-
havecmd fmpp || build_fmpp
104+
hash -r
105+
[[ -n "$(which fmpp 2>/dev/null)" ]] || build_fmpp
102106

103107
upgrade_mcuconf_files
104108
upgrade_chconf_files

0 commit comments

Comments
 (0)