summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/measurestack/app_main.py12
-rw-r--r--build-aux/measurestack/app_plugins.py26
2 files changed, 28 insertions, 10 deletions
diff --git a/build-aux/measurestack/app_main.py b/build-aux/measurestack/app_main.py
index 397dc31..9a31338 100644
--- a/build-aux/measurestack/app_main.py
+++ b/build-aux/measurestack/app_main.py
@@ -49,6 +49,7 @@ def main(
plugins += [
app_plugins.CmdPlugin(),
libobj_plugin,
+ app_plugins.PicoFmtPlugin(arg_pico_platform),
app_plugins.LibHWPlugin(arg_pico_platform, libobj_plugin),
app_plugins.LibCRPlugin(),
app_plugins.LibCRIPCPlugin(),
@@ -67,7 +68,6 @@ def main(
return ret
plugins += [
- app_plugins.PicoFmtPlugin(),
app_plugins.PicoSDKPlugin(
get_init_array=get_init_array,
),
@@ -88,10 +88,12 @@ def main(
return 0, False
def misc_filter(name: QName) -> tuple[int, bool]:
- if name.base() in [
- BaseName("__assert_msg_fail"),
- BaseName("fmt_vfctprintf"),
- BaseName("fmt_vsnprintf"),
+ if name in [
+ QName("__assert_msg_fail"),
+ QName("__lm_printf"),
+ QName("__lm_light_printf"),
+ QName("fmt_vfctprintf"),
+ QName("fmt_vsnprintf"),
]:
return 1, False
return 0, False
diff --git a/build-aux/measurestack/app_plugins.py b/build-aux/measurestack/app_plugins.py
index 1eee739..064ea06 100644
--- a/build-aux/measurestack/app_plugins.py
+++ b/build-aux/measurestack/app_plugins.py
@@ -448,7 +448,7 @@ class LibMiscPlugin:
def _skipmodel___assert_msg_fail(
self, chain: typing.Sequence[QName], call: QName
) -> bool:
- if call.base() in [BaseName("__lm_printf")]:
+ if call.base() in [BaseName("__lm_printf"), BaseName("__lm_light_printf")]:
return any(
c.base() == BaseName("__assert_msg_fail") for c in reversed(chain[:-1])
)
@@ -458,14 +458,30 @@ class LibMiscPlugin:
class PicoFmtPlugin:
known_fct: dict[BaseName, BaseName]
- def __init__(self) -> None:
+ def __init__(self, arg_pico_platform: str) -> None:
self.known_fct = {
# pico_fmt
BaseName("fmt_vsnprintf"): BaseName("_out_buffer"),
- # pico_stdio
- BaseName("__wrap_vprintf"): BaseName("stdio_buffered_printer"),
- BaseName("stdio_vprintf"): BaseName("stdio_buffered_printer"),
}
+ match arg_pico_platform:
+ case "rp2040":
+ self.known_fct.update(
+ {
+ # pico_stdio
+ BaseName("__wrap_vprintf"): BaseName("stdio_buffered_printer"),
+ BaseName("stdio_vprintf"): BaseName("stdio_buffered_printer"),
+ # libfmt
+ BaseName("__lm_light_printf"): BaseName("libfmt_light_fct"),
+ }
+ )
+ case "host":
+ self.known_fct.update(
+ {
+ # libfmt
+ BaseName("__lm_printf"): BaseName("libfmt_libc_fct"),
+ BaseName("__lm_light_printf"): BaseName("libfmt_libc_fct"),
+ }
+ )
def is_intrhandler(self, name: QName) -> bool:
return False