uMIDI
The swiss army knife for quick and easy developement of MIDI applications.
Data Structures | Functions | Variables
switcher.c File Reference

Implementation of the MIDI switcher module. More...

#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <avr/io.h>
#include <avr/wdt.h>
#include <util/delay.h>
#include "lib/background_tasks.h"
#include "lib/gpio.h"
#include "lib/leds.h"
#include "lib/program.h"
#include "lib/usb.h"
#include "config.h"
#include "switcher.h"
Include dependency graph for switcher.c:

Data Structures

union  program_data
 

Functions

void execute_program (uint32_t program_data)
 Replace current program by given program_data and update relays accordingly. More...
 
bool exec_backup (const char *command)
 Handler for the backup command. More...
 
bool exec_load (const char *command)
 Handler for the load command. More...
 
bool exec_relay (const char *command)
 Handler for the relays command. More...
 
bool exec_restore (const char *command)
 Handler for the restore command. More...
 
bool exec_save (const char *command)
 Handler for the save command. More...
 
void handle_program_change (uint8_t program)
 Callback for unimplemented midi messages. More...
 
void unknown_midi_message_handler (void)
 Task for polling all switches and update current program. More...
 
void poll_switches (void)
 

Variables

static union program_data current_program
 Switch configuration of the current program. More...
 
static union program_data effective_program
 The current switch configuration. More...
 

Detailed Description

Implementation of the MIDI switcher module.

Function Documentation

◆ exec_backup()

bool exec_backup ( const char *  command)

Handler for the backup command.

◆ exec_load()

bool exec_load ( const char *  command)

Handler for the load command.

◆ exec_relay()

bool exec_relay ( const char *  command)

Handler for the relays command.

◆ exec_restore()

bool exec_restore ( const char *  command)

Handler for the restore command.

◆ exec_save()

bool exec_save ( const char *  command)

Handler for the save command.

◆ execute_program()

void execute_program ( uint32_t  program_data)

Replace current program by given program_data and update relays accordingly.

Callback for program changes

◆ handle_program_change()

void handle_program_change ( uint8_t  program)

Callback for unimplemented midi messages.

◆ poll_switches()

void poll_switches ( void  )

◆ unknown_midi_message_handler()

void unknown_midi_message_handler ( void  )

Task for polling all switches and update current program.

Variable Documentation

◆ current_program

union program_data current_program
static

Switch configuration of the current program.

◆ effective_program

union program_data effective_program
static

The current switch configuration.