diff --git a/Template/MFCustomDevice.cpp b/Template/MFCustomDevice.cpp index 849f391..bd2fe99 100644 --- a/Template/MFCustomDevice.cpp +++ b/Template/MFCustomDevice.cpp @@ -2,7 +2,7 @@ #include "commandmessenger.h" #include "allocateMem.h" #include "MFEEPROM.h" -#ifdef HAS_CONFIG_IN_FLASH +#if defined(HAS_CONFIG_IN_FLASH) #include "MFCustomDevicesConfig.h" #else const char CustomDeviceConfig[] PROGMEM = {}; diff --git a/Template/MyCustomDevice_platformio.ini b/Template/MyCustomDevice_platformio.ini index 4a9e44f..0caf354 100644 --- a/Template/MyCustomDevice_platformio.ini +++ b/Template/MyCustomDevice_platformio.ini @@ -9,6 +9,9 @@ build_flags = ;-DMF_CUSTOMDEVICE_HAS_UPDATE ; if the custom device needs to be updated, uncomment this. W/o the following define it will be done each loop() ;-DMF_CUSTOMDEVICE_POLL_MS=10 ; time in ms between updating custom device, uncomment this if custom device needs to be updated regulary ;-DHAS_CONFIG_IN_FLASH ; undefine this and add your configuration to MFCustomDevicesConfig.h to save the config in Flash !!Core FW version must be at least 2.5.2!! + ;-DREVERSED_OUTPUT_OUTPUT ; for reversed output logic on outputs + ;-DREVERSED_OUTPUT_OUTPUTSHIFTER ; for reversed output logic on outputshifter + ;-DDEBUG2CMDMESSENGER ; uncomment this to get debug messages for the connector log -I./src/src/MF_CustomDevice ; don't change this one! -I./Template ; Include files for your custom device, replace "Template" by your folder name build_src_filter = @@ -26,9 +29,13 @@ board = megaatmega2560 framework = arduino build_flags = ${env_template.build_flags} ; don't change this one! - -I./src/_Boards/Atmel/Board_Mega ; Include the required board definition. If you need your own definition, adapt this to your path (e.g. -I./CustomDevices/_template/_Boards) '-DMOBIFLIGHT_TYPE="Mobiflight Template Mega"' ; this must match with "MobiFlightType" within the .json file '-DMOBIFLIGHT_NAME="Mobiflight Template"' ; this will show up as Name in the settings dialog unless it gets change from there + -DMEMLEN_CONFIG=1496 ; max. size for config which wil be stored in EEPROM + -DMEMLEN_NAMES_BUFFER=1000 ; max. size for configBuffer, contains only names from inputs + -DMF_MAX_DEVICEMEM=1600 ; max. memory size for devices +build_unflags = + ;-DMF_STEPPER_SUPPORT ; this is just an example how to deactivate a device build_src_filter = ${env.build_src_filter} ; don't change this one! ${env_template.build_src_filter} ; don't change this one! @@ -51,9 +58,13 @@ board = sparkfun_promicro16 framework = arduino build_flags = ${env_template.build_flags} ; don't change this one! - -I./src/_Boards/Atmel/Board_ProMicro ; Include the required board definition. If you need your own definition, adapt this to your path (e.g. -I./CustomDevices/_template/_Boards) '-DMOBIFLIGHT_TYPE="Mobiflight Template Micro"' ; this must match with "MobiFlightType" within the .json file '-DMOBIFLIGHT_NAME="Mobiflight Template"' ; this will show up as Name in the settings dialog unless it gets change from there + -DMEMLEN_CONFIG=440 ; max. size for config which wil be stored in EEPROM + -DMEMLEN_NAMES_BUFFER=350 ; max. size for configBuffer, contains only names from inputs + -DMF_MAX_DEVICEMEM=470 ; max. memory size for devices +build_unflags = + ;-DMF_STEPPER_SUPPORT ; this is just an example how to deactivate a device build_src_filter = ${env.build_src_filter} ; don't change this one! ${env_template.build_src_filter} ; don't change this one! @@ -77,9 +88,13 @@ board = uno framework = arduino build_flags = ${env_template.build_flags} ; don't change this one! - -I./src/_Boards/Atmel/Board_Uno ; Include the required board definition. If you need your own definition, adapt this to your path (e.g. -I./CustomDevices/_template/_Boards) '-DMOBIFLIGHT_TYPE="Mobiflight Template Uno"' ; this must match with "MobiFlightType" within the .json file '-DMOBIFLIGHT_NAME="Mobiflight Template"' ; this will show up as Name in the settings dialog unless it gets change from there + -DMEMLEN_CONFIG=286 ; max. size for config which wil be stored in EEPROM + -DMEMLEN_NAMES_BUFFER=220 ; max. size for configBuffer, contains only names from inputs + -DMF_MAX_DEVICEMEM=420 ; max. memory size for devices +build_unflags = + ;-DMF_STEPPER_SUPPORT ; this is just an example how to deactivate a device build_src_filter = ${env.build_src_filter} ; don't change this one! ${env_template.build_src_filter} ; don't change this one! @@ -103,9 +118,13 @@ board = nanoatmega328 framework = arduino build_flags = ${env_template.build_flags} ; don't change this one! - -I./src/_Boards/Atmel/Board_Nano ; Include the required board definition. If you need your own definition, adapt this to your path (e.g. -I./CustomDevices/_template/_Boards) '-DMOBIFLIGHT_TYPE="Mobiflight Template Nano"' ; this must match with "MobiFlightType" within the .json file '-DMOBIFLIGHT_NAME="Mobiflight Template"' ; this will show up as Name in the settings dialog unless it gets change from there + -DMEMLEN_CONFIG=286 ; max. size for config which wil be stored in EEPROM + -DMEMLEN_NAMES_BUFFER=220 ; max. size for configBuffer, contains only names from inputs + -DMF_MAX_DEVICEMEM=420 ; max. memory size for devices +build_unflags = + ;-DMF_STEPPER_SUPPORT ; this is just an example how to deactivate a device build_src_filter = ${env.build_src_filter} ; don't change this one! ${env_template.build_src_filter} ; don't change this one! @@ -133,9 +152,13 @@ lib_ldf_mode = chain+ upload_protocol = mbed build_flags = ${env_template.build_flags} ; don't change this one! - -I./src/_Boards/RaspberryPi/Pico ; Include the required board definition. If you need your own definition, adapt this to your path (e.g. -I./CustomDevices/_template/_Boards) '-DMOBIFLIGHT_TYPE="Mobiflight Template RaspiPico"' ; this must match with "MobiFlightType" within the .json file '-DMOBIFLIGHT_NAME="Mobiflight Template"' ; this will show up as Name in the settings dialog unless it gets change from there + -DMEMLEN_CONFIG=1496 ; max. size for config which wil be stored in EEPROM + -DMEMLEN_NAMES_BUFFER=1000 ; max. size for configBuffer, contains only names from inputs + -DMF_MAX_DEVICEMEM=1000 ; max. memory size for devices +build_unflags = + ;-DMF_STEPPER_SUPPORT ; this is just an example how to deactivate a device build_src_filter = ${env.build_src_filter} ; don't change this one! ${env_template.build_src_filter} ; don't change this one! diff --git a/platformio.ini b/platformio.ini index 7d8d5c9..1e19786 100644 --- a/platformio.ini +++ b/platformio.ini @@ -29,7 +29,16 @@ build_flags = -DMESSENGERBUFFERSIZE=96 -DMAXSTREAMBUFFERSIZE=96 -DDEFAULT_TIMEOUT=5000 -; -DDEBUG2CMDMESSENGER=1 + -DMF_SEGMENT_SUPPORT + -DMF_LCD_SUPPORT + -DMF_STEPPER_SUPPORT + -DMF_SERVO_SUPPORT + -DMF_ANALOG_SUPPORT + -DMF_OUTPUT_SHIFTER_SUPPORT + -DMF_INPUT_SHIFTER_SUPPORT + -DMF_MUX_SUPPORT + -DMF_MUX_SUPPORT + -DMF_DIGIN_MUX_SUPPORT -I./src/src -I./src/src/MF_Analog -I./src/src/MF_Button