From 2fee408d6fe0964e245dc0bae90027baa13b159a Mon Sep 17 00:00:00 2001 From: Nicholas Tay Date: Wed, 11 May 2022 19:22:08 +1000 Subject: Improve plugin loading architecture This should be better, maybe the variable names could be better though. Init is more extensible, we take in a 'board_data' struct on the plugin end that has everything it needs (mainly function pointers for now). Then, a 'board' struct is given back to the main Clak runtime, with everything it needs to know (again, mainly function pointers). It is a bit weird that the board is not stored with Clak but as a pointer to the dynamically loaded bit, but not sure. --- board/quack/board.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'board/quack/board.c') diff --git a/board/quack/board.c b/board/quack/board.c index 893e366..9a58e2f 100644 --- a/board/quack/board.c +++ b/board/quack/board.c @@ -1,12 +1,4 @@ #include "sound.h" - -#include "../board.c" - -void board_on_down(void) -{ - sound_play(quack_board_down_wav); -} - -void board_on_up(void) -{ -} \ No newline at end of file +#define BOARD_NAME "Quack Quack" +#define BOARD_DOWN_WAV quack_board_down_wav +#include "../simple_board.h" \ No newline at end of file -- cgit