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"
__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
@ -25,16 +25,12 @@ void * matrix_init_kb(void) {
DDRE |= (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
// 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 } \
}
void * matrix_init_user(void);
void * matrix_scan_user(void);
void matrix_init_user(void);
void matrix_scan_user(void);
#endif

View File

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

View File

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

View File

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

View File

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

View File

@ -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
matrix_init_user();
}
if (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();
}

View File

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

View File

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