#include "Plug.h" /**********************************************************************************************\ * Load plugins * oreginal file name plugin.c, bat with this name g++ compiler have problem * therefore I create Plugin_001.cpp who contain #include to oreginal Plugin_001.c * and I create Plugin_001.h who contain all nessery headers file for compile and enable * use those modules in main program * Those files is generated by GNU make (only for enabled plagin in ../Config/Config_02.c) * PS: by GNU make is also generated files who is used here: * ./Plugins/Make_Generated_all_h.h * ./Plugins/Make_Generated_all_RX.h * ./Plugins/Make_Generated_all_TX.h \*********************************************************************************************/ /********************************************** * example Plugin_001.cpp : * * #include "Plugin_001.h" * #ifdef PLUGIN_001 * #include "../../Plugins/Plugin_001.c" * #endif **********************************************/ /********************************************** * example Plugin_001.h : * * #ifndef _plugin_001_h * #define _plugin_001_h * #include "../../Config/Config_02.c" * #ifdef PLUGIN_001 * #include "../Global.h" * //prototype functions * boolean Plugin_001(byte function, char *string); * #endif * #endif * *********************************************/ // Van alle devices die worden mee gecompileerd, worden in een tabel de adressen opgeslagen zodat hier naar toe gesprongen kan worden boolean (*Plugin_ptr[PLUGIN_MAX])(byte, char*); // Receive plugins byte Plugin_id[PLUGIN_MAX]; boolean (*PluginTX_ptr[PLUGIN_TX_MAX])(byte, char*); // Transmit plugins byte PluginTX_id[PLUGIN_TX_MAX]; /*********************************************************************************************/ void PluginInit(void) { byte x; // Wis de pointertabel voor de plugins. for(x=0;x