AwesomeStudioPedal
A programmable, multi-profile foot controller for DAWs, score readers, and studio automation
Loading...
Searching...
No Matches
main.cpp File Reference

Main application entry point for Awesome Guitar Pedal. More...

#include <Arduino.h>
#include <memory>
#include "ble_keyboard_adapter.h"
#include "platform.h"
#include "button.h"
#include "button_constants.h"
#include "config.h"
#include "config_loader.h"
#include "delayed_action.h"
#include "event_dispatcher.h"
#include "led_controller.h"
#include "pedal_config.h"
#include "profile_manager.h"
#include "send_action.h"

Go to the source code of this file.

Typedefs

using IsrFunc = void(*)()
 

Functions

LEDController ledBluetooth (hardwareConfig.ledBluetooth)
 
LEDController ledPower (hardwareConfig.ledPower)
 
void signalLoadError ()
 Signal a configuration load error by blinking all LEDs, then fall back to the hardcoded factory default via configureProfiles().
 
void attachInterrupts ()
 Attaches interrupt handlers to all buttons.
 
void IRAM_ATTR isr_buttons (uint8_t index)
 
Button BUTTON_SELECT (hardwareConfig.buttonSelect)
 
void IRAM_ATTR isr_btn0 ()
 
void IRAM_ATTR isr_btn1 ()
 
void IRAM_ATTR isr_btn2 ()
 
void IRAM_ATTR isr_btn3 ()
 
void IRAM_ATTR isr_btn4 ()
 
void IRAM_ATTR isr_btn5 ()
 
void IRAM_ATTR isr_btn6 ()
 
void IRAM_ATTR isr_btn7 ()
 
void IRAM_ATTR isr_btn8 ()
 
void IRAM_ATTR isr_btn9 ()
 
void IRAM_ATTR isr_btn10 ()
 
void IRAM_ATTR isr_btn11 ()
 
void IRAM_ATTR isr_btn12 ()
 
void IRAM_ATTR isr_btn13 ()
 
void IRAM_ATTR isr_btn14 ()
 
void IRAM_ATTR isr_btn15 ()
 
void IRAM_ATTR isr_btn16 ()
 
void IRAM_ATTR isr_btn17 ()
 
void IRAM_ATTR isr_btn18 ()
 
void IRAM_ATTR isr_btn19 ()
 
void IRAM_ATTR isr_btn20 ()
 
void IRAM_ATTR isr_btn21 ()
 
void IRAM_ATTR isr_btn22 ()
 
void IRAM_ATTR isr_btn23 ()
 
void IRAM_ATTR isr_btn24 ()
 
void IRAM_ATTR isr_btn25 ()
 
void IRAM_ATTR isr_select ()
 
void setup_hardware ()
 Initializes all hardware components.
 
void executeActionWithLogging (uint8_t buttonIndex)
 Executes an action with proper logging.
 
void setup_event_handlers ()
 Configures event handlers for all buttons.
 
void setup ()
 Arduino setup function - runs once at startup.
 
void detachInterrupts ()
 Detaches interrupt handlers from all buttons.
 
void process_events ()
 Processes button events and dispatches them to handlers.
 
void loop ()
 Arduino main loop - runs repeatedly.
 

Variables

BleKeyboardAdapterbleKeyboardAdapter = createBleKeyboardAdapter()
 
bool connected = false
 
LEDControllerselectLedObjects [ProfileManager::MAX_SELECT_LEDS] = {}
 
std::vector< ILEDController * > selectLeds
 
ButtonactionButtonObjects [Btn::MAX] = {}
 
ProfileManagerprofileManager = nullptr
 
EventDispatcher eventDispatcher
 

Detailed Description

Main application entry point for Awesome Guitar Pedal.

This file contains the setup, loop, and core application logic for the ESP32-based guitar pedal controller.

Definition in file main.cpp.

Typedef Documentation

◆ IsrFunc

using IsrFunc = void (*)()

Definition at line 141 of file main.cpp.

Function Documentation

◆ attachInterrupts()

void attachInterrupts ( )

Attaches interrupt handlers to all buttons.

Definition at line 268 of file main.cpp.

◆ BUTTON_SELECT()

Button BUTTON_SELECT ( hardwareConfig.  buttonSelect)

◆ detachInterrupts()

void detachInterrupts ( )

Detaches interrupt handlers from all buttons.

Definition at line 282 of file main.cpp.

◆ executeActionWithLogging()

void executeActionWithLogging ( uint8_t  buttonIndex)

Executes an action with proper logging.

Definition at line 176 of file main.cpp.

◆ isr_btn0()

void IRAM_ATTR isr_btn0 ( )

Definition at line 112 of file main.cpp.

◆ isr_btn1()

void IRAM_ATTR isr_btn1 ( )

Definition at line 113 of file main.cpp.

◆ isr_btn10()

void IRAM_ATTR isr_btn10 ( )

Definition at line 122 of file main.cpp.

◆ isr_btn11()

void IRAM_ATTR isr_btn11 ( )

Definition at line 123 of file main.cpp.

◆ isr_btn12()

void IRAM_ATTR isr_btn12 ( )

Definition at line 124 of file main.cpp.

◆ isr_btn13()

void IRAM_ATTR isr_btn13 ( )

Definition at line 125 of file main.cpp.

◆ isr_btn14()

void IRAM_ATTR isr_btn14 ( )

Definition at line 126 of file main.cpp.

◆ isr_btn15()

void IRAM_ATTR isr_btn15 ( )

Definition at line 127 of file main.cpp.

◆ isr_btn16()

void IRAM_ATTR isr_btn16 ( )

Definition at line 128 of file main.cpp.

◆ isr_btn17()

void IRAM_ATTR isr_btn17 ( )

Definition at line 129 of file main.cpp.

◆ isr_btn18()

void IRAM_ATTR isr_btn18 ( )

Definition at line 130 of file main.cpp.

◆ isr_btn19()

void IRAM_ATTR isr_btn19 ( )

Definition at line 131 of file main.cpp.

◆ isr_btn2()

void IRAM_ATTR isr_btn2 ( )

Definition at line 114 of file main.cpp.

◆ isr_btn20()

void IRAM_ATTR isr_btn20 ( )

Definition at line 132 of file main.cpp.

◆ isr_btn21()

void IRAM_ATTR isr_btn21 ( )

Definition at line 133 of file main.cpp.

◆ isr_btn22()

void IRAM_ATTR isr_btn22 ( )

Definition at line 134 of file main.cpp.

◆ isr_btn23()

void IRAM_ATTR isr_btn23 ( )

Definition at line 135 of file main.cpp.

◆ isr_btn24()

void IRAM_ATTR isr_btn24 ( )

Definition at line 136 of file main.cpp.

◆ isr_btn25()

void IRAM_ATTR isr_btn25 ( )

Definition at line 137 of file main.cpp.

◆ isr_btn3()

void IRAM_ATTR isr_btn3 ( )

Definition at line 115 of file main.cpp.

◆ isr_btn4()

void IRAM_ATTR isr_btn4 ( )

Definition at line 116 of file main.cpp.

◆ isr_btn5()

void IRAM_ATTR isr_btn5 ( )

Definition at line 117 of file main.cpp.

◆ isr_btn6()

void IRAM_ATTR isr_btn6 ( )

Definition at line 118 of file main.cpp.

◆ isr_btn7()

void IRAM_ATTR isr_btn7 ( )

Definition at line 119 of file main.cpp.

◆ isr_btn8()

void IRAM_ATTR isr_btn8 ( )

Definition at line 120 of file main.cpp.

◆ isr_btn9()

void IRAM_ATTR isr_btn9 ( )

Definition at line 121 of file main.cpp.

◆ isr_buttons()

void IRAM_ATTR isr_buttons ( uint8_t  index)

Definition at line 103 of file main.cpp.

◆ isr_select()

void IRAM_ATTR isr_select ( )

Definition at line 139 of file main.cpp.

◆ ledBluetooth()

LEDController ledBluetooth ( hardwareConfig.  ledBluetooth)

◆ ledPower()

LEDController ledPower ( hardwareConfig.  ledPower)

◆ loop()

void loop ( )

Arduino main loop - runs repeatedly.

Definition at line 315 of file main.cpp.

◆ process_events()

void process_events ( )

Processes button events and dispatches them to handlers.

Definition at line 296 of file main.cpp.

◆ setup()

void setup ( )

Arduino setup function - runs once at startup.

Definition at line 235 of file main.cpp.

◆ setup_event_handlers()

void setup_event_handlers ( )

Configures event handlers for all buttons.

Definition at line 213 of file main.cpp.

◆ setup_hardware()

void setup_hardware ( )

Initializes all hardware components.

Definition at line 152 of file main.cpp.

◆ signalLoadError()

void signalLoadError ( )

Signal a configuration load error by blinking all LEDs, then fall back to the hardcoded factory default via configureProfiles().

Definition at line 79 of file main.cpp.

Variable Documentation

◆ actionButtonObjects

Button* actionButtonObjects[Btn::MAX] = {}

Definition at line 70 of file main.cpp.

◆ bleKeyboardAdapter

Definition at line 32 of file main.cpp.

◆ connected

bool connected = false

Definition at line 60 of file main.cpp.

◆ eventDispatcher

EventDispatcher eventDispatcher

Definition at line 73 of file main.cpp.

◆ profileManager

ProfileManager* profileManager = nullptr

Definition at line 72 of file main.cpp.

◆ selectLedObjects

Definition at line 66 of file main.cpp.

◆ selectLeds

std::vector<ILEDController*> selectLeds

Definition at line 67 of file main.cpp.