Merge pull request #378 from ed-xmos/feature/midi_test

MIDI tests
This commit is contained in:
Ed
2024-04-25 10:55:37 +01:00
committed by GitHub
27 changed files with 1637 additions and 513 deletions

View File

@@ -1,4 +1,4 @@
// Copyright 2011-2021 XMOS LIMITED.
// Copyright 2011-2024 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef MIDIINPARSE_XH
#define MIDIINPARSE_XH
@@ -19,8 +19,11 @@ struct midi_in_parse_state {
unsigned codeIndexNumber;
};
void dump_midi_in_parse_state(struct midi_in_parse_state &s);
#ifdef __XC__
void reset_midi_state(struct midi_in_parse_state &mips);
void dump_midi_in_parse_state(struct midi_in_parse_state &s);
{unsigned int , unsigned int} midi_in_parse(struct midi_in_parse_state &mips, unsigned cable_number, unsigned char b);
#endif
#endif

View File

@@ -1,4 +1,4 @@
// Copyright 2013-2021 XMOS LIMITED.
// Copyright 2013-2024 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#ifndef QUEUE_H_
#define QUEUE_H_
@@ -14,6 +14,8 @@ typedef struct queue_t {
unsigned mask;
} queue_t;
#ifdef __XC__
inline int is_power_of_2(unsigned x) {
return x != 0 && (x & (x - 1)) == 0;
}
@@ -64,4 +66,6 @@ inline unsigned queue_space(const queue_t &q) {
return q.size - queue_items(q);
}
#endif // __XC__
#endif /* QUEUE_H_ */