Fix: remove extern C wrappers around Zephyr headers (cbprintf_cxx linkage conflict)
This commit is contained in:
parent
8a8b5cdc67
commit
ff2230735e
5 changed files with 1 additions and 44 deletions
|
|
@ -17,10 +17,8 @@
|
||||||
#include "static_allocate.h"
|
#include "static_allocate.h"
|
||||||
#include "stroke.h"
|
#include "stroke.h"
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include <zephyr/kernel.h>
|
#include <zephyr/kernel.h>
|
||||||
#include <zephyr/logging/log.h>
|
#include <zephyr/logging/log.h>
|
||||||
}
|
|
||||||
|
|
||||||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
#include "clock.h"
|
#include "clock.h"
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include <zephyr/kernel.h>
|
#include <zephyr/kernel.h>
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t Clock::GetMilliseconds() { return k_uptime_get_32(); }
|
uint32_t Clock::GetMilliseconds() { return k_uptime_get_32(); }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,9 @@
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include <zephyr/kernel.h>
|
#include <zephyr/kernel.h>
|
||||||
#include <zephyr/logging/log.h>
|
#include <zephyr/logging/log.h>
|
||||||
}
|
|
||||||
|
|
||||||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||||
|
|
||||||
// Route Javelin console output to ZMK logging system.
|
|
||||||
// In Phase 5, this can be upgraded to USB CDC ACM for interactive console.
|
|
||||||
|
|
||||||
static char line_buf[256];
|
static char line_buf[256];
|
||||||
static size_t line_pos = 0;
|
static size_t line_pos = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,8 @@
|
||||||
#include "flash.h"
|
#include "flash.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include <zephyr/device.h>
|
#include <zephyr/device.h>
|
||||||
#include <zephyr/drivers/flash.h>
|
#include <zephyr/drivers/flash.h>
|
||||||
#include <zephyr/storage/flash_map.h>
|
|
||||||
}
|
|
||||||
|
|
||||||
// Flash partition IDs — must match DTS overlay.
|
|
||||||
// steno_dict_partition: compiled dictionary (read-only at runtime)
|
|
||||||
// steno_user_partition: user dictionary (read-write)
|
|
||||||
//
|
|
||||||
// Javelin's Flash class uses raw pointers into XIP-mapped flash.
|
|
||||||
// On nRF52840, internal flash is memory-mapped at 0x00000000.
|
|
||||||
// We convert between XIP pointers and partition offsets.
|
|
||||||
|
|
||||||
#ifndef FIXED_PARTITION_ID
|
|
||||||
#define FIXED_PARTITION_ID(label) FLASH_AREA_ID(label)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Flash::instance is defined in javelin/flash.cc (high-level methods).
|
|
||||||
// We only provide the platform-specific EraseBlockInternal/WriteBlockInternal.
|
|
||||||
|
|
||||||
// Convert XIP address to flash device offset.
|
|
||||||
// nRF52840 internal flash is at 0x00000000, so pointer == offset.
|
|
||||||
static off_t xip_to_offset(const void *ptr) {
|
static off_t xip_to_offset(const void *ptr) {
|
||||||
return (off_t)(uintptr_t)ptr;
|
return (off_t)(uintptr_t)ptr;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,8 @@
|
||||||
#include "key_code.h"
|
#include "key_code.h"
|
||||||
|
|
||||||
#include <zephyr/kernel.h>
|
#include <zephyr/kernel.h>
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include <zmk/event_manager.h>
|
#include <zmk/event_manager.h>
|
||||||
#include <zmk/events/keycode_state_changed.h>
|
#include <zmk/events/keycode_state_changed.h>
|
||||||
}
|
|
||||||
|
|
||||||
// Javelin KeyCode layout:
|
|
||||||
// 0x04-0xE7 → USB HID Keyboard page (0x07)
|
|
||||||
// 0xE0-0xE7 → Modifier keys (subset of keyboard page)
|
|
||||||
// 0x10000+ → Consumer page (0x0C), usage = value & 0xFFFF
|
|
||||||
|
|
||||||
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;
|
||||||
|
|
@ -46,7 +38,4 @@ void Key::Press(KeyCode key) { emit_keycode(key, true); }
|
||||||
|
|
||||||
void Key::Release(KeyCode key) { emit_keycode(key, false); }
|
void Key::Release(KeyCode key) { emit_keycode(key, false); }
|
||||||
|
|
||||||
void Key::Flush() {
|
void Key::Flush() {}
|
||||||
// ZMK processes events asynchronously via its event queue.
|
|
||||||
// Flush is a no-op — events are dispatched as they're raised.
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue