Add introspection.c example.

This commit is contained in:
Nick Brassel 2025-02-07 23:20:02 +11:00
commit 6f4db948e3
No known key found for this signature in database
2 changed files with 9 additions and 1 deletions

View file

@ -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;
}

View 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);
}