diff --git a/modules/hello_world/hello_world.c b/modules/hello_world/hello_world.c index 9a4a70f492..0dbe2ce817 100644 --- a/modules/hello_world/hello_world.c +++ b/modules/hello_world/hello_world.c @@ -4,8 +4,10 @@ ASSERT_COMMUNITY_MODULES_MIN_API_VERSION(20250122); +extern int keymap_byte_count(void); // example of use of introspection + uint32_t delayed_hello_world(uint32_t trigger_time, void *cb_arg) { - print("Hello, world! I'm a QMK based keyboard!\n"); + printf("Hello, world! I'm a QMK based keyboard! The keymap array size is %d bytes.\n", keymap_byte_count()); return 0; } diff --git a/modules/hello_world/introspection.c b/modules/hello_world/introspection.c new file mode 100644 index 0000000000..f33371c8f7 --- /dev/null +++ b/modules/hello_world/introspection.c @@ -0,0 +1,6 @@ +// Copyright 2025 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later + +int keymap_byte_count(void) { + return sizeof(keymaps); +}