From 2a3940d8a36433485a6ef489d5123cd491618b50 Mon Sep 17 00:00:00 2001 From: Duncan Wilkie Date: Mon, 7 Aug 2023 17:29:29 -0500 Subject: slave progress and WCET --- controller/inc/base_midi.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'controller/inc') diff --git a/controller/inc/base_midi.h b/controller/inc/base_midi.h index 8320803..b6e5b19 100644 --- a/controller/inc/base_midi.h +++ b/controller/inc/base_midi.h @@ -8,7 +8,8 @@ // Configuration. #define DEBUG 0 // If defined, enable input safety checking (e.g. too large data bytes, bad ID numbers, etc). // These checks have some performance downside. -#define RUNNING_STATUS 0 // If defined, the MIDI instrument stores a transmit status and uses running statuses whenever possible. +/* #define RUNNING_STATUS 0 // If defined, the MIDI instrument stores a transmit status and uses running statuses whenever possible .*/ + #define KEY_ON_VELOCITY 0 // If defined, the MIDI instrument sends velocities with Note On messages. #undef RELEASE_VELOCITY // If defined, the MIDI instrument sends Note Off messages with velocities. // Otherwise, sends Note On velocity 0 or Note Off velocity 0 according to ACTUAL_OFF_MESSAGE. @@ -69,7 +70,17 @@ typedef struct { bool (*unimplemented_universal_sysex_collector)(uint8_t); // Same as above. Parsing ends with end_of_sysex_handler. } ConsumerBehavior; -extern ConsumerBehavior pfns; // Initialize this globally in your main. +typedef struct { + uint8_t status; + bool first_byte; + uint8_t byte0; + bool send_eox; + uint8_t *stack; + size_t top; + size_t size; +} ParserMemory; + +void midi_init(ConsumerBehavior new_pfns); // System exclusive sends. void sysex(uint16_t manufacturer_id, uint8_t* contents, size_t contents_len); -- cgit v1.2.3