Is there a best practices (preferred) config top structure?

How are you structuring the list for your configuration top section? I was wondering if switching where things are listed would make more sense not just for the way I think but also in terms of passing along the learning or even just plain optimization.

Functionally this example works but I seem to remember there’s a best way to do it.

#ifdef CONFIG_TOP

#include "proffieboard_v2_config.h"
#define NUM_BLADES 1
#define NUM_BUTTONS 2
#define VOLUME 1700
#define ENABLE_ALL_EDIT_OPTIONS
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 3.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SERIAL
#define ENABLE_SD
#define COLOR_CHANGE_DIRECT
#define DISABLE_DIAGNOSTIC_COMMANDS
#define FETT263_MULTI_PHASE
#define FETT263_SWING_ON
#define FETT263_STAB_ON
#define FETT263_THRUST_ON
#define FETT263_LOCKUP_DELAY 200
#define FETT263_BATTLE_MODE_START_ON
#define FETT263_EDIT_MODE_MENU
#define FETT263_SAY_COLOR_LIST
#define FETT263_SAY_BATTERY_PERCENT
#define DISABLE_BASIC_PARSER_STYLES
#define FETT263_TWIST_OFF
#define SHARED_POWER_PINS
#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
#define MOTION_TIMEOUT 60 * 5 * 1000
#define SAVE_STATE
#endif

Versus listing by step and priority IIRC?

#ifdef CONFIG_TOP

#include "proffieboard_v2_config.h"
#define NUM_BLADES 1
#define NUM_BUTTONS 2
#define VOLUME 1700
#define CLASH_THRESHOLD_G 3.0
#define COLOR_CHANGE_DIRECT
#define DISABLE_DIAGNOSTIC_COMMANDS
#define DISABLE_BASIC_PARSER_STYLES
#define ENABLE_ALL_EDIT_OPTIONS
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
const unsigned int maxLedsPerStrip = 144;
#define ENABLE_SERIAL
#define ENABLE_SD
#define FETT263_MULTI_PHASE
#define FETT263_SWING_ON
#define FETT263_STAB_ON
#define FETT263_THRUST_ON
#define FETT263_TWIST_OFF
#define FETT263_LOCKUP_DELAY 200
#define FETT263_BATTLE_MODE_START_ON
#define FETT263_EDIT_MODE_MENU
#define FETT263_SAY_COLOR_LIST
#define FETT263_SAY_BATTERY_PERCENT
#define SHARED_POWER_PINS
#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
#define MOTION_TIMEOUT 60 * 5 * 1000
#define SAVE_STATE
#endif

I don’t think there are any established best practices for this yet.

This is what mine looks like in all configs.
I just comment out what i don’t want for a particular upload.

#ifdef CONFIG_TOP
#include "proffieboard_v1_config.h"
#define NUM_BLADES 3
#define NUM_BUTTONS 1
#define VOLUME 100
const unsigned int maxLedsPerStrip = 144; 
#define EXTRA_COLOR_BUFFER_SPACE 30               // New define that can speed up processing a bit. Basically, it can calculate the colors for the next blade (or the next frame for the same blade) even though it's not done feeding out the data for the data in the color buffer yet.
#define CLASH_THRESHOLD_G 3.5
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define ENABLE_SERIAL //Bluetooth or UART TTL
#define SHARED_POWER_PINS
#define SAVE_STATE
    // #define SAVE_VOLUME
    // #define SAVE_PRESET
    // #define SAVE_COLOR_CHANGE
    // #define SAVE_DYNAMIC_DIMMING
// #define KEEP_SAVEFILES_WHEN_PROGRAMMING     // upload overwrites presets.ini/tmp unless this is defined
// #define DISABLE_COLOR_CHANGE
#define BLADE_DETECT_PIN blade3Pin
// #define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
// #define BLADE_ID_CLASS ExternalPullupBladeID<bladeIdentifyPin, 33000>
// #define BLADE_ID_CLASS SnapshotBladeID<bladeIdentifyPin> // This will make it use the speed-of-charging-a-capacitor method of blade ID which sometimes works without resistors 
//                         Blade ID can detect if a blade is connected or not, but it won't actually reach the NO_BLADE value, so I would recommend using something like 200000 instead of NO_BLADE.
// #define SPEAK_BLADE_ID
// #define ENABLE_I2S_OUT
// #deefine ENABLE_SPDIF_OUT
// #define LINE_OUT_VOLUME 2000                    // SPDIF out
#define ENABLE_DEVELOPER_COMMANDS
// #define DISABLE_DIAGNOSTIC_COMMANDS
#define IDLE_OFF_TIME 60 * 5 * 1000
#define MOTION_TIMEOUT 60 * 5 * 1000
// #define ORIENTATION ORIENTATION_FETS_TOWARDS_BLADE
// #define ORIENTATION ORIENTATION_USB_TOWARDS_BLADE
// #define ORIENTATION ORIENTATION_TOP_TOWARDS_BLADE
// #define ORIENTATION ORIENTATION_BOTTOM_TOWARDS_BLADE
// #define ORIENTATION ORIENTATION_SDA_TOWARDS_BLADE
// #define ORIENTATION ORIENTATION_SERIAL_TOWARDS_BLADE
// #define ORIENTATION_ROTATION 0,-20,0
//changes the angle required to register twists on curved hilts
//example is for assaj ventress curved hit install

// #define CONFIG_STARTUP_DELAY 15000              // BC now canon
#define FEMALE_TALKIE_VOICE                       // BC now canon
#define VOLUME_MENU_CYCLE                         // BC now canon
#define NO_REPEAT_RANDOM                          // BC now canon

// ------- OLED stuff ----------

#define ENABLE_SSD1306                            // OLED
//#define OLED_FLIP_180                             // BC now canon
//#define OLED_MIRRORED
#define USE_AUREBESH_FONT                      // BC now canon
#define OLED_SYNCED_EFFECTS
// #define PLI_OFF_TIME 60 * 5 * 1000 // 300000 ms = 5 mins
// ------- Gesture stuff -------

#define BC_SWING_ON
#define BC_SWING_ON_SPEED 250
#define BC_STAB_ON
#define BC_THRUST_ON
#define BC_TWIST_ON
#define BC_TWIST_OFF
#define BC_FORCE_PUSH
#define BC_FORCE_PUSH_LENGTH 5
#define ENABLE_AUTO_SWING_BLAST                   // BC Multiblast continues as long as swinging within 1 second. 
#define ENABLE_SPINS 
// #define GESTURE_AUTO_BATTLE_MODE
#define BC_LOCKUP_DELAY 200

// ------- Custom / Experimental stuff ---------

#define DISABLE_BASIC_PARSER_STYLES               // Standard, Advanced, etc...
// #define NO_VOLUME_MENU                            // self evident
#define NO_BLADE_NO_GEST_ONOFF                    // If using blade detect, No Blade = No Gesture ignitions or retractions
#define AUTO_HUMSTART                             // 200ms delay from out.wav beginning all the time.             **Requires modified hybrid_font.h file.
#define ENABLE_AUTO_SPINS_BLAST                   // Same as auto-multi-blast but for spins. 2 second window.    **Required modified prop_base.h
// #define LOW_BATT_ONCE                          // No repeated warnings
// #define LOW_BATT_WARNINGS_TIERED                // meh...just annoying if not accurate..likely.                                                            **Requires modified hybrid_font.h file.
// #define ENABLE_GESTURE_MENU                    // PSISTORM prop - cool stuff! the TrySound else beep void.

// #define FILTER_CUTOFF_FREQUENCY 100
// #define FILTER_ORDER 8

#define ENABLE_ALL_EDIT_OPTIONS
    // #define DYNAMIC_BLADE_LENGTH
    // #define DYNAMIC_BLADE_DIMMING
    // #define DYNAMIC_CLASH_THRESHOLD
    // #define SAVE_VOLUME
    // #define SAVE_BLADE_DIMMING
    // #define SAVE_CLASH_THRESHOLD
    // #define SAVE_COLOR_CHANGE

// --------- blaster --------------

#define ENABLE_BLASTER_AUTO
#define BLASTER_SHOTS_UNTIL_EMPTY 15  // (whatever number)
#define BLASTER_JAM_PERCENTAGE 10     // if not defined, random.

#endif
1 Like