Merge pull request #190 from yoyoerx/function_pointers
Addressing void* return warning & coding styleexample_keyboards
commit
403d756ad5
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
#a tool to fix broken keymaps as a result of pull request #190
|
||||
#changing the declaration of matrix_scan_user() and matrix_init_user()
|
||||
#
|
||||
#This script will save a copy of the specified keymap as keymap.c.bak
|
||||
#and then create a new keymap.c with the definion corrected.
|
||||
#this script must be run from the ergodox_ez directory
|
||||
if [ $# -ne 1 ]; then
|
||||
echo $0: usage: ./190hotfix keymap_name
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo Saving backup as ./keymaps/$1/keymap.c.bak ...
|
||||
mv ./keymaps/$1/keymap.c ./keymaps/$1/keymap.c.bak
|
||||
|
||||
echo Modifying ./keymaps/$1/keymap.c ...
|
||||
cat ./keymaps/$1/keymap.c.bak | sed -r 's/^void \* matrix_/void matrix_/'>./keymaps/$1/keymap.c
|
||||
|
||||
echo Complete!
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
#a quick tool to rebuild all the hex files for the keymaps in the ./keymaps/ directory
|
||||
make clean
|
||||
for f in ./keymaps/*
|
||||
do
|
||||
MAPNAME=$(echo "$f"|sed -r 's#^./keymaps/##')
|
||||
make KEYMAP=$MAPNAME
|
||||
mv ergodox_ez.hex "$f/$MAPNAME.hex"
|
||||
done
|
@ -1,29 +1,23 @@
|
||||
#include "%KEYBOARD%.h"
|
||||
|
||||
__attribute__ ((weak))
|
||||
void * matrix_init_user(void) {
|
||||
void matrix_init_user(void) {
|
||||
// leave these blank
|
||||
};
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void * matrix_scan_user(void) {
|
||||
void matrix_scan_user(void) {
|
||||
// leave these blank
|
||||
};
|
||||
}
|
||||
|
||||
void * matrix_init_kb(void) {
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
if (matrix_init_user) {
|
||||
(*matrix_init_user)();
|
||||
matrix_init_user();
|
||||
}
|
||||
};
|
||||
|
||||
void * matrix_scan_kb(void) {
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
if (matrix_scan_user) {
|
||||
(*matrix_scan_user)();
|
||||
matrix_scan_user();
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue