Fix linker: disable ortho cache, stub CancelAllStenoKeys, stub flash, fix C linkage for raise_zmk_keycode_state_changed
This commit is contained in:
parent
21f1804527
commit
d40dc7f537
4 changed files with 29 additions and 17 deletions
|
|
@ -187,6 +187,7 @@ print(f'Stripped test blocks from {count} files')
|
||||||
src/platform/zmk_flash_shim.cc
|
src/platform/zmk_flash_shim.cc
|
||||||
src/platform/zmk_connection_shim.cc
|
src/platform/zmk_connection_shim.cc
|
||||||
src/platform/zmk_console_shim.cc
|
src/platform/zmk_console_shim.cc
|
||||||
|
src/platform/zmk_stubs.cc
|
||||||
)
|
)
|
||||||
|
|
||||||
# ZMK behavior driver (C, not C++)
|
# ZMK behavior driver (C, not C++)
|
||||||
|
|
@ -234,6 +235,7 @@ print(f'Stripped test blocks from {count} files')
|
||||||
JAVELIN_PLATFORM_ZEPHYR=1
|
JAVELIN_PLATFORM_ZEPHYR=1
|
||||||
JAVELIN_BOARD_CONFIG=<stddef.h>
|
JAVELIN_BOARD_CONFIG=<stddef.h>
|
||||||
M_PI=3.14159265358979323846
|
M_PI=3.14159265358979323846
|
||||||
|
USE_ORTHOGRAPHY_CACHE=0
|
||||||
)
|
)
|
||||||
# Test suppression handled by include/javelin_overrides/unit_test.h
|
# Test suppression handled by include/javelin_overrides/unit_test.h
|
||||||
# which shadows Javelin's unit_test.h via include path ordering.
|
# which shadows Javelin's unit_test.h via include path ordering.
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,18 @@
|
||||||
#include "flash.h"
|
#include "flash.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
#include <zephyr/device.h>
|
|
||||||
#include <zephyr/drivers/flash.h>
|
|
||||||
|
|
||||||
static off_t xip_to_offset(const void *ptr) {
|
// Stub implementations — real flash ops deferred until flash partition configured.
|
||||||
return (off_t)(uintptr_t)ptr;
|
// EraseBlockInternal/WriteBlockInternal are weak in javelin/flash.cc.
|
||||||
}
|
// Our strong definitions here override them.
|
||||||
|
|
||||||
void Flash::EraseBlockInternal(const void *target, size_t size) {
|
void Flash::EraseBlockInternal(const void *target, size_t size) {
|
||||||
const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_flash));
|
(void)target;
|
||||||
if (!device_is_ready(dev)) {
|
(void)size;
|
||||||
return;
|
|
||||||
}
|
|
||||||
flash_erase(dev, xip_to_offset(target), size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Flash::WriteBlockInternal(const void *target, const void *data,
|
void Flash::WriteBlockInternal(const void *target, const void *data,
|
||||||
size_t size) {
|
size_t size) {
|
||||||
const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_flash));
|
(void)target;
|
||||||
if (!device_is_ready(dev)) {
|
(void)data;
|
||||||
return;
|
(void)size;
|
||||||
}
|
|
||||||
flash_write(dev, xip_to_offset(target), data, size);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,20 @@
|
||||||
#include "key_code.h"
|
#include "key_code.h"
|
||||||
|
|
||||||
#include <zephyr/kernel.h>
|
#include <zephyr/kernel.h>
|
||||||
#include <zmk/event_manager.h>
|
|
||||||
#include <zmk/events/keycode_state_changed.h>
|
// ZMK event headers need C linkage for the function declarations
|
||||||
|
// but Zephyr's own headers are C++-safe.
|
||||||
|
extern "C" {
|
||||||
|
struct zmk_keycode_state_changed {
|
||||||
|
uint16_t usage_page;
|
||||||
|
uint32_t keycode;
|
||||||
|
uint8_t implicit_modifiers;
|
||||||
|
uint8_t explicit_modifiers;
|
||||||
|
bool state;
|
||||||
|
int64_t timestamp;
|
||||||
|
};
|
||||||
|
int raise_zmk_keycode_state_changed(struct zmk_keycode_state_changed ev);
|
||||||
|
}
|
||||||
|
|
||||||
static constexpr uint16_t HID_USAGE_PAGE_KEYBOARD = 0x07;
|
static constexpr uint16_t HID_USAGE_PAGE_KEYBOARD = 0x07;
|
||||||
static constexpr uint16_t HID_USAGE_PAGE_CONSUMER = 0x0C;
|
static constexpr uint16_t HID_USAGE_PAGE_CONSUMER = 0x0C;
|
||||||
|
|
|
||||||
5
src/platform/zmk_stubs.cc
Normal file
5
src/platform/zmk_stubs.cc
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
// Stubs for Javelin platform functions not relevant to ZMK.
|
||||||
|
|
||||||
|
#include "button_script.h"
|
||||||
|
|
||||||
|
void ButtonScript::CancelAllStenoKeys() {}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue