Compare commits

...

4 Commits

Author SHA1 Message Date
Sergey Vlasov 584b7cf801
Fix build failures with `OPT = 0` due to inline functions (#19767)
Co-authored-by: Joel Challis <git@zvecr.com>
2023-02-12 17:14:34 +11:00
Drashna Jaelre b1f4d49c43
[Bug] Fix tri layer compiler issue if NO_ACTION_LAYER is defined (#19821) 2023-02-12 17:07:01 +11:00
jack 9c6942ea40
Remove `config.h` include from quantum files (#19817) 2023-02-12 02:40:16 +00:00
jack ab1dd0faab
Fixup ek65 -- add processor & bootloader in info.json (#19815) 2023-02-12 02:01:48 +00:00
10 changed files with 38 additions and 4 deletions

View File

@ -8,6 +8,8 @@
"pid": "0x0002",
"device_version": "0.0.1"
},
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"layouts": {
"LAYOUT_all": {
"layout":[

View File

@ -2,6 +2,8 @@ PLATFORM_COMMON_DIR = $(PLATFORM_PATH)/$(PLATFORM_KEY)
TMK_COMMON_SRC += \
$(PLATFORM_PATH)/suspend.c \
$(PLATFORM_PATH)/synchronization_util.c \
$(PLATFORM_PATH)/timer.c \
$(PLATFORM_COMMON_DIR)/hardware_id.c \
$(PLATFORM_COMMON_DIR)/platform.c \
$(PLATFORM_COMMON_DIR)/suspend.c \

View File

@ -0,0 +1,17 @@
// Copyright 2023 Sergey Vlasov (@sigprof)
// SPDX-License-Identifier: GPL-2.0-or-later
#include "synchronization_util.h"
// Generate out-of-line copies for inline functions defined in synchronization_util.h.
#if !defined(PLATFORM_SUPPORTS_SYNCHRONIZATION)
# if defined(SPLIT_KEYBOARD)
extern inline void split_shared_memory_lock(void);
extern inline void split_shared_memory_unlock(void);
# endif
#endif
#if defined(SPLIT_KEYBOARD)
QMK_IMPLEMENT_AUTOUNLOCK_HELPERS(split_shared_memory)
#endif

View File

@ -29,6 +29,12 @@ inline void split_shared_memory_unlock(void){};
prefix##_unlock(); \
}
/* Generate an out-of-line implementation in case the inline functions defined
* by the above macro don't actually get inlined. */
#define QMK_IMPLEMENT_AUTOUNLOCK_HELPERS(prefix) \
extern inline unsigned prefix##_autounlock_lock_helper(void); \
extern inline void prefix##_autounlock_unlock_helper(unsigned* unused_guard);
/* Convinience macro the automatically generate the correct RAII-style
* lock_autounlock function macro */
#define QMK_DECLARE_AUTOUNLOCK_CALL(prefix) unsigned prefix##_guard __attribute__((unused, cleanup(prefix##_autounlock_unlock_helper))) = prefix##_autounlock_lock_helper

8
platforms/timer.c Normal file
View File

@ -0,0 +1,8 @@
// Copyright 2023 Sergey Vlasov (@sigprof)
// SPDX-License-Identifier: GPL-2.0-or-later
#include "timer.h"
// Generate out-of-line copies for inline functions defined in timer.h.
extern inline fast_timer_t timer_read_fast(void);
extern inline fast_timer_t timer_elapsed_fast(fast_timer_t last);

View File

@ -350,6 +350,7 @@ action_t layer_switch_get_action(keypos_t key) {
return action_for_key(layer_switch_get_layer(key), key);
}
#ifndef NO_ACTION_LAYER
layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3) {
layer_state_t mask12 = ((layer_state_t)1 << layer1) | ((layer_state_t)1 << layer2);
layer_state_t mask3 = (layer_state_t)1 << layer3;
@ -359,3 +360,4 @@ layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_
void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
layer_state_set(update_tri_layer_state(layer_state, layer1, layer2, layer3));
}
#endif

View File

@ -19,7 +19,6 @@
#include "led_matrix.h"
#include "progmem.h"
#include "config.h"
#include "eeprom.h"
#include <string.h>
#include <math.h>

View File

@ -24,7 +24,7 @@
#include "debug.h"
#include "mousekey.h"
inline int8_t times_inv_sqrt2(int8_t x) {
static inline int8_t times_inv_sqrt2(int8_t x) {
// 181/256 is pretty close to 1/sqrt(2)
// 0.70703125 0.707106781
// 1 too small for x=99 and x=198

View File

@ -18,7 +18,6 @@
#include "rgb_matrix.h"
#include "progmem.h"
#include "config.h"
#include "eeprom.h"
#include <string.h>
#include <math.h>

View File

@ -16,7 +16,6 @@
#include "split_util.h"
#include "matrix.h"
#include "keyboard.h"
#include "config.h"
#include "timer.h"
#include "transport.h"
#include "quantum.h"