1
0
Fork 0

Addressed void* return warning & coding style

This commit is contained in:
yoyoerx 2016-03-09 14:04:14 -05:00
parent 7d3ebd7b40
commit d58b14e880
9 changed files with 45 additions and 63 deletions

View file

@ -1,16 +1,16 @@
#include "atomic.h" #include "atomic.h"
__attribute__ ((weak)) __attribute__ ((weak))
void * matrix_init_user(void) { void matrix_init_user(void) {
// leave these blank // leave these blank
}; }
__attribute__ ((weak)) __attribute__ ((weak))
void * matrix_scan_user(void) { void matrix_scan_user(void) {
// leave these blank // leave these blank
}; }
void * matrix_init_kb(void) { void matrix_init_kb(void) {
// put your keyboard start-up code here // put your keyboard start-up code here
// runs once when the firmware starts up // runs once when the firmware starts up
@ -25,16 +25,12 @@ void * matrix_init_kb(void) {
DDRE |= (1<<6); DDRE |= (1<<6);
PORTE |= (1<<6); PORTE |= (1<<6);
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 // put your looping keyboard code here
// runs every cycle (a lot) // runs every cycle (a lot)
if (matrix_scan_user) { matrix_scan_user();
(*matrix_scan_user)(); }
}
};

View file

@ -24,7 +24,7 @@
{ K40, K41, KC_NO, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E } \ { K40, K41, KC_NO, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E } \
} }
void * matrix_init_user(void); void matrix_init_user(void);
void * matrix_scan_user(void); void matrix_scan_user(void);
#endif #endif

View file

@ -150,7 +150,7 @@ float start_up[][2] = {
{440.0*pow(2.0,(64)/12.0), 1000}, {440.0*pow(2.0,(64)/12.0), 1000},
}; };
void * matrix_init_user(void) { void matrix_init_user(void) {
init_notes(); init_notes();
play_notes(&start_up, 9, false); play_notes(&start_up, 9, false);
} }

View file

@ -1,16 +1,16 @@
#include "planck.h" #include "planck.h"
__attribute__ ((weak)) __attribute__ ((weak))
void * matrix_init_user(void) { void matrix_init_user(void) {
}; }
__attribute__ ((weak)) __attribute__ ((weak))
void * matrix_scan_user(void) { void matrix_scan_user(void) {
}; }
void * matrix_init_kb(void) { void matrix_init_kb(void) {
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_ENABLE
backlight_init_ports(); backlight_init_ports();
#endif #endif
@ -24,13 +24,9 @@ void * matrix_init_kb(void) {
DDRE |= (1<<6); DDRE |= (1<<6);
PORTE |= (1<<6); PORTE |= (1<<6);
if (matrix_init_user) { matrix_init_user();
(*matrix_init_user)(); }
}
};
void * matrix_scan_kb(void) { void matrix_scan_kb(void) {
if (matrix_scan_user) { matrix_scan_user();
(*matrix_scan_user)(); }
}
};

View file

@ -40,7 +40,7 @@
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \
} }
void * matrix_init_user(void); void matrix_init_user(void);
void * matrix_scan_user(void); void matrix_scan_user(void);
#endif #endif

View file

@ -48,14 +48,14 @@ static void unselect_rows(void);
static void select_row(uint8_t row); static void select_row(uint8_t row);
__attribute__ ((weak)) __attribute__ ((weak))
void * matrix_init_kb(void) { void matrix_init_kb(void) {
}; }
__attribute__ ((weak)) __attribute__ ((weak))
void * matrix_scan_kb(void) { void matrix_scan_kb(void) {
}; }
inline inline
uint8_t matrix_rows(void) uint8_t matrix_rows(void)
@ -86,9 +86,7 @@ void matrix_init(void)
matrix_debouncing[i] = 0; matrix_debouncing[i] = 0;
} }
if (matrix_init_kb) { matrix_init_kb();
(*matrix_init_kb)();
}
} }
@ -152,9 +150,7 @@ uint8_t matrix_scan(void)
} }
#endif #endif
if (matrix_scan_kb) { matrix_scan_kb();
(*matrix_scan_kb)();
}
return 1; return 1;
} }

View file

@ -1,29 +1,23 @@
#include "%KEYBOARD%.h" #include "%KEYBOARD%.h"
__attribute__ ((weak)) __attribute__ ((weak))
void * matrix_init_user(void) { void matrix_init_user(void) {
// leave these blank // leave these blank
}; }
__attribute__ ((weak)) __attribute__ ((weak))
void * matrix_scan_user(void) { void matrix_scan_user(void) {
// leave these blank // leave these blank
}; }
void * matrix_init_kb(void) { void matrix_init_kb(void) {
// put your keyboard start-up code here // put your keyboard start-up code here
// runs once when the firmware starts up // runs once when the firmware starts up
matrix_init_user();
}
if (matrix_init_user) { void matrix_scan_kb(void) {
(*matrix_init_user)();
}
};
void * matrix_scan_kb(void) {
// put your looping keyboard code here // put your looping keyboard code here
// runs every cycle (a lot) // runs every cycle (a lot)
matrix_scan_user();
if (matrix_scan_user) { }
(*matrix_scan_user)();
}
};

View file

@ -19,7 +19,7 @@
{ k10, KC_NO, k11 }, \ { k10, KC_NO, k11 }, \
} }
void * matrix_init_user(void); void matrix_init_user(void);
void * matrix_scan_user(void); void matrix_scan_user(void);
#endif #endif

View file

@ -64,8 +64,8 @@ void matrix_power_up(void);
void matrix_power_down(void); void matrix_power_down(void);
/* keyboard-specific setup/loop functionality */ /* keyboard-specific setup/loop functionality */
void * matrix_init_kb(void); void matrix_init_kb(void);
void * matrix_scan_kb(void); void matrix_scan_kb(void);
#ifdef __cplusplus #ifdef __cplusplus
} }