Add introspection.c example.
This commit is contained in:
parent
3a5c075cf7
commit
6f4db948e3
2 changed files with 9 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
6
modules/hello_world/introspection.c
Normal file
6
modules/hello_world/introspection.c
Normal file
|
|
@ -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);
|
||||
}
|
||||
Loading…
Reference in a new issue