Skip to content

Commit 1f81cc9

Browse files
Francois Bestfacchinm
authored andcommitted
Move event packet type declaration into a separate header (#47)
* refactor: Move event packet declaration into a separate header This would allow 3rd party code to work with this data type without including the whole interface code, which is environment-specific.
1 parent b93e9fe commit 1f81cc9

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/MIDIUSB.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@
1818
#error MIDIUSB can only be used with an USB MCU.
1919
#endif
2020

21-
typedef struct
22-
{
23-
uint8_t header;
24-
uint8_t byte1;
25-
uint8_t byte2;
26-
uint8_t byte3;
27-
}midiEventPacket_t;
21+
#include "MIDIUSB_Defs.h"
2822

2923
#if defined(ARDUINO_ARCH_AVR)
3024

src/MIDIUSB_Defs.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#pragma once
2+
#include <stdint.h>
3+
4+
typedef struct
5+
{
6+
uint8_t header;
7+
uint8_t byte1;
8+
uint8_t byte2;
9+
uint8_t byte3;
10+
} midiEventPacket_t;

0 commit comments

Comments
 (0)