Compare commits

...

3 Commits

Author SHA1 Message Date
unicod 7d5f7adb9b todo pincfg 2 months ago
unicod e2672b9d91 gitinfo 2 months ago
unicod c090887b80 uml state diagram generator 2 months ago

@ -1,5 +1,6 @@
#include <MIDI.h>
#include "gitdefs.h"
#include "pincfg.h"
#include "TimedPin.h"
#include "ui.h"

@ -2,10 +2,11 @@
#define __PINCFG_H__
typedef enum: uint8_t {
PIN_MODE_DIG_IN,
PIN_MODE_DIG_IN = 0,
PIN_MODE_ANA_IN,
PIN_MODE_DIG_OUT,
PIN_MODE_ANA_OUT
PIN_MODE_ANA_OUT,
PIN_MODE_UNUSED = 0xFF
} PIN_MODES;
typedef enum: uint8_t {
@ -13,11 +14,55 @@ typedef enum: uint8_t {
PULLUP_ON
} PULLUP_MODES;
typedef enum: uint8_t {
EDGE_RISING,
EDGE_FALLING
} EDGE_POLARITY;
typedef enum: uint8_t {
MIDI_CMD_SNAPSHOT = 0, // call snapshot
MIDI_CMD_FADER_ABS, // direct set fader value
MIDI_CMD_FADER_REL, // inc/dec fader value
MIDI_CMD_MUTE, // direct set mute state
MIDI_CMD_MUTE_TOGGLE, // toggle mute state
MIDI_CMD_PAN, // direct set panorama
MIDI_CMD_NONE = 0xFF // no command assigned
} MIDI_CMD_TYPES;
struct MidiSelVal {
uint8_t chsel; // control element select (channel ID)
uint8_t val; // value of control element
};
struct MidiFaderRel {
uint8_t chsel; // fader chan ID
int8_t step; // step size (neg:downward, pos:upward)
uint8_t min; // lowest fader value
uint8_t max; // highest fader value
};
struct MidiMute {
uint8_t chsel; // mute chan ID
uint8_t edgecfg; // -1:
};
union MidiCmdCfg {
uint8_t Snapshot;
MidiSelVal FaderAbs;
MidiSelVal Mute;
MidiSelVal Pan;
MidiFaderRel FaderRel;
MidiMuteToggle MuteToggle;
};
struct PinCfg {
uint8_t PinSel;
PIN_MODES Mode;
union {
struct {
PULLUP_MODES Pullup;
MIDI_CMD_TYPES MidiCmd;
} CfgDigIn;
struct {
uint8_t todo;

@ -60,7 +60,7 @@ static void UiSt_Home(UI_SM* me, uint16_t event);
//u @startuml
//u skinparam defaultTextAlignment left
//u state UserInterface {
//u state UserInterface as "User Interface" {
/***************************************************************************//**
* @brief Initialize state machine for user interface
@ -132,7 +132,7 @@ void UiSt_MixerStartup(UI_SM* const me, uint16_t event) {
case EV_UI_RX_MUTE_CH1_OFF:
case EV_UI_RX_MUTE_CH2_ON:
case EV_UI_RX_MUTE_CH2_OFF: { // mixer alive
SM_SET_STATE(&UiSt_Home);
SM_SET_STATE(&UiSt_Home); //u MixerStartup --> Home : mixer alive\n(MIDI rx)
}break;
case EV_UI_TICK_1S: {
@ -141,7 +141,7 @@ void UiSt_MixerStartup(UI_SM* const me, uint16_t event) {
MIDI.sendControlChange(fader.MidiCtrlNr, fader.FaderStd - ((me->Timer >> 1) % 2), 1); // ping mixer with changing value (std, std-1, std,...)
}
if (++me->Timer == 15) {
SM_SET_STATE(&UiSt_Home); //u MixerStartup -left-> Home : timeout
SM_SET_STATE(&UiSt_Home); //u MixerStartup --> Home : timeout\n15s
}
}break;
}
@ -164,7 +164,7 @@ void UiSt_Home(UI_SM* const me, uint16_t event) {
}
switch (event) {
case EV_STATE_ENTER: {
LedBoard.Blink(30, 270, 5);
LedBoard.Blink(30, 470, 15);
// initialize mixer
for (uint_fast8_t i=0; i<ELEMCNT(AirMutes); i++) {
MixerMuteState& mute = AirMutes[i];

@ -0,0 +1,10 @@
#!/usr/bin/gawk -f
# Execute for every lines
{
umlkey = "//u ";
pos = index($0, umlkey);
if (pos) {
print substr($0, pos + length(umlkey))
}
}

@ -0,0 +1,8 @@
set path=%path%;C:\MinGW\msys\1.0\bin
set PLANTUML=C:\Tools\plantuml\plantuml.jar
if not exist doc mkdir doc
gawk -f uml.awk ui.cpp > doc\ui.uml
cd doc
java -jar %PLANTUML% -charset UTF-8 -tsvg ui.uml
cd ..
Loading…
Cancel
Save