Skip to content

Commit 2d9606a

Browse files
committed
v1.7.3 supports Teensyduino 1.53
1 parent 4d57527 commit 2d9606a

18 files changed

+68
-64
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
# BMC the Badass MIDI Controller For Teensy 3.x & 4.x!
88

9+
***Version 1.7.3 Supports Teensyduino 1.58, previous version will not compile without modifications***
10+
911
***Version 1.5.0 Now includes Logic Control Support, make your own DAW MIDI Controller!***
1012

1113
***Version 1.2.0 Teensy LC is no longer supported as it doesn't have enough Flash to hold BMC + Debugging, this makes it very difficult to ensure compatibility.***

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=BMC
2-
version=1.7.2
2+
version=1.7.3
33
author=Nero Rox
44
maintainer=Nero Rox <info@roxxxtar.com>
55
sentence=Fully featured MIDI Controller Library with a Companion Editor App for 32-bit Teensy boards, Requires Teensyduino.

src/BMC-Version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// BMC Version stored in EEPROM (for editor usage)
2424
#define BMC_VERSION_MAJ 1
2525
#define BMC_VERSION_MIN 7
26-
#define BMC_VERSION_PATCH 2
26+
#define BMC_VERSION_PATCH 3
2727

2828
//16 bits unsigned, LSB byte is minor, MSB byte is major
2929
#define BMC_VERSION ((BMC_VERSION_MAJ<<8) | BMC_VERSION_MIN)

src/display/BMC-Display.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ class BMCDisplay {
4444
dawMetersBlock = -1;
4545
dawVuOverload = 0;
4646
dawSelectedTrack = -1;
47-
memset(dawVPotLevel, 0, 8);
48-
memset(dawVPotBits, 0, 8);
49-
memset(dawVuLevel, 0, 8);
50-
memset(dawVuLevelBits, 0, 8);
51-
memset(dawChStates, 0, 8);
47+
memset(dawVPotLevel, 0, sizeof(dawVPotLevel[0])*8);
48+
memset(dawVPotBits, 0, sizeof(dawVPotBits[0])*8);
49+
memset(dawVuLevel, 0, sizeof(dawVuLevel[0])*8);
50+
memset(dawVuLevelBits, 0, sizeof(dawVuLevelBits[0])*8);
51+
memset(dawChStates, 0, sizeof(dawChStates[0])*8);
5252
for(uint8_t i=0;i<8;i++){
53-
memset(dawChName[i], 0, 8);
53+
memset(dawChName[i], 0, sizeof(dawChName[0][0])*8);
5454
}
5555
#endif
5656
#if BMC_MAX_OLED > 0
@@ -105,13 +105,14 @@ class BMCDisplay {
105105
dawMetersBlock = -1;
106106
dawVuOverload = 0;
107107
dawSelectedTrack = -1;
108-
memset(dawVPotLevel, 0, 8);
109-
memset(dawVPotBits, 0, 8);
110-
memset(dawVuLevel, 0, 8);
111-
memset(dawVuLevelBits, 0, 8);
112-
memset(dawChStates, 0, 8);
108+
109+
memset(dawVPotLevel, 0, sizeof(dawVPotLevel[0])*8);
110+
memset(dawVPotBits, 0, sizeof(dawVPotBits[0])*8);
111+
memset(dawVuLevel, 0, sizeof(dawVuLevel[0])*8);
112+
memset(dawVuLevelBits, 0, sizeof(dawVuLevelBits[0])*8);
113+
memset(dawChStates, 0, sizeof(dawChStates[0])*8);
113114
for(uint8_t i=0;i<8;i++){
114-
memset(dawChName[i], 0, 8);
115+
memset(dawChName[i], 0, sizeof(dawChName[0][0])*8);
115116
}
116117
#endif
117118

src/editor/BMC-Editor.backup.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void BMCEditor::backupGlobalPreset(uint16_t t_minLength){
118118
item.length = BMC_MAX_PRESET_ITEMS;
119119
}
120120
// set all bytes in the event array to 0
121-
memset(item.events, 0, BMC_MAX_PRESET_ITEMS);
121+
memset(item.events, 0, sizeof(item.events[0])*BMC_MAX_PRESET_ITEMS);
122122
// e is the offset where we start in the sysex array
123123
// it will be used to keep track of where we are and for the
124124
// name if it's compiled
@@ -190,7 +190,7 @@ void BMCEditor::backupGlobalSetList(uint16_t t_minLength){
190190
item.length = BMC_MAX_SETLISTS_SONGS;
191191
}
192192
// set all bytes in the event array to 0
193-
memset(item.songs, 0, BMC_MAX_SETLISTS_SONGS);
193+
memset(item.songs, 0, sizeof(item.songs[0])*BMC_MAX_SETLISTS_SONGS);
194194
// e is the offset where we start in the sysex array
195195
// it will be used to keep track of where we are and for the
196196
// name if it's compiled
@@ -356,7 +356,7 @@ void BMCEditor::backupPixelProgram(uint16_t t_minLength){
356356
item.length = 8;
357357
}
358358
// set all bytes in the event array to 0
359-
memset(item.events, 0, 8);
359+
memset(item.events, 0, sizeof(item.events[0])*8);
360360
for(uint8_t i = 0, e = 10; i < 8 ; i++, e+=2){
361361
item.events[i] = incoming.get8Bits(e);
362362
}

src/editor/BMC-Editor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,8 @@ class BMCEditor {
836836
BMC_PRINTLN("EEPROM Store",address,"is being Erased.");
837837
BMC_WARN_FOOT;
838838
// clear the current store in RAM by setting all bytes to 0
839-
memset(&store,0,sizeof(bmcStore));
839+
// memset(&store,0,sizeof(bmcStore));
840+
store = {};
840841
// add the CRC
841842
store.crc = (BMC_CRC); // update the CRC
842843
store.version = (BMC_VERSION); // update the library version

src/editor/BMC-Editor.midi.global.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ void BMCEditor::globalPreset(bool write){
878878
item.length = BMC_MAX_PRESET_ITEMS;
879879
}
880880
uint8_t e = 10;
881-
memset(item.events, 0, BMC_MAX_PRESET_ITEMS);
881+
memset(item.events, 0, sizeof(item.events[0])*BMC_MAX_PRESET_ITEMS);
882882
for(uint8_t i = 0 ; i < BMC_MAX_PRESET_ITEMS ; i++){
883883
item.events[i] = (bmcLibrary_t) incoming.get14Bits(e);
884884
if(item.events[i] >= BMC_MAX_LIBRARY){
@@ -990,7 +990,7 @@ void BMCEditor::globalSetList(bool write){
990990
item.length = BMC_MAX_SETLISTS_SONGS;
991991
}
992992
uint8_t e = 10;
993-
memset(item.songs, 0, BMC_MAX_SETLISTS_SONGS);
993+
memset(item.songs, 0, sizeof(item.songs[0])*BMC_MAX_SETLISTS_SONGS);
994994
for(uint8_t i = 0 ; i < BMC_MAX_SETLISTS_SONGS ; i++){
995995
item.songs[i] = (bmcPreset_t) incoming.get14Bits(e);
996996
if(item.songs[i] >= BMC_MAX_PRESETS){
@@ -1276,7 +1276,7 @@ void BMCEditor::globalPixelProgram(bool write){
12761276
if(item.length > 8){
12771277
item.length = 8;
12781278
}
1279-
memset(item.events, 0, 8);
1279+
memset(item.events, 0, sizeof(item.events[0])*8);
12801280
for(uint8_t i = 0, e = 10 ; i < 8 ; i++, e += 2){
12811281
item.events[i] = incoming.get8Bits(e);
12821282
}

src/hardware/BMC-Pixels.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ class BMCPixels {
669669
pulseTimer[n].stop();
670670
currentColor[n] = 0;
671671
}
672-
memset(rgbPulseReset, 0, BMC_MAX_RGB_PIXELS);
672+
memset(rgbPulseReset, 0, sizeof(rgbPulseReset[0])*BMC_MAX_RGB_PIXELS);
673673
#endif
674674

675675
if(showPixels){

src/midi/BMC-SerialBle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class BMCSerialBle {
6464
public:
6565
BMCSerialBle(BMCGlobals& t_globals):
6666
globals(t_globals){
67-
memset(txBuffer,0,BMC_BLE_MIDI_TX_BUFFER_SIZE);
67+
memset(txBuffer, 0, sizeof(txBuffer[0])*BMC_BLE_MIDI_TX_BUFFER_SIZE);
6868
txTimestamps = 1;
6969
}
7070
operator bool(){

src/mux/BMC-MuxInAnalog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class BMCMuxInAnalog {
4343
BMC_PRINTLN("You must read the chip with your sketch and use bmc.setMuxInAnalogValue(pin, value) to set the values of the pins used.");
4444
BMC_PRINTLN("BMC will handle smoothing the analog values, make sure these are 10-bits.");
4545
BMC_PRINTLN("");
46-
memset(values, 0, BMC_MAX_MUX_IN_ANALOG);
46+
memset(values, 0, sizeof(values[0])*BMC_MAX_MUX_IN_ANALOG);
4747
#else
4848
mux.begin();
4949
delay(10);

src/mux/BMC-MuxInAnalog74HC40XX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ class BMCMuxInAnalog74HC40XX {
348348

349349
BMC_PRINTLN(" BMC_MAX_MUX_IN_ANALOG", BMC_MAX_MUX_IN_ANALOG);
350350

351-
memset(values, 0, BMC_MAX_MUX_IN_ANALOG);
351+
memset(values, 0, sizeof(values[0])*BMC_MAX_MUX_IN_ANALOG);
352352

353353
for(uint8_t i = 0, n = totalMux ; i < n ; i++){
354354
// set the signal pins that will read an analog signal from the mux

src/storage/BMC-Store.h

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
typedef uint8_t bmcEvent_t;
1515
typedef uint8_t bmcName_t;
1616
// BMC Event Object for BMC 2.0
17-
struct __attribute__ ((packed)) bmcStoreEvent {
17+
struct bmcStoreEvent {
1818
bmcName_t name = 0;
1919
uint8_t settings = 0;
2020
uint8_t ports = 0;
@@ -23,20 +23,20 @@
2323
2424
// BMC Device Object for BMC 2.0
2525
template <uint8_t sLen=1, uint8_t eLen=1>
26-
struct __attribute__ ((packed)) bmcStoreDevice {
26+
struct bmcStoreDevice {
2727
bmcName_t name = 0;
2828
uint8_t settings[sLen];
2929
bmcEvent_t events[eLen];
3030
};
3131
3232
// BMC Name Object for BMC 2.0
3333
template <uint8_t len=1>
34-
struct __attribute__ ((packed)) bmcStoreName {
34+
struct bmcStoreName {
3535
char name[len] = "";
3636
};
3737
3838
39-
struct __attribute__ ((packed)) bmcNewStore {
39+
struct bmcNewStore {
4040
bmcStoreEvent events[16];
4141
bmcStoreName <16> names[16];
4242
bmcStoreDevice <1, 4> buttons[2];
@@ -48,20 +48,20 @@
4848
*/
4949

5050
// Button Event Object
51-
struct __attribute__ ((packed)) bmcStoreButtonEvent {
51+
struct bmcStoreButtonEvent {
5252
uint8_t mode = 0;
5353
uint8_t ports = 0;
5454
uint32_t event = 0;
5555
};
5656
// Button Object
57-
struct __attribute__ ((packed)) bmcStoreButton {
57+
struct bmcStoreButton {
5858
bmcStoreButtonEvent events[BMC_MAX_BUTTON_EVENTS];
5959
#if BMC_NAME_LEN_BUTTONS> 1
6060
char name[BMC_NAME_LEN_BUTTONS] = "";
6161
#endif
6262
};
6363
// Potentiometer object
64-
struct __attribute__ ((packed)) bmcStorePot {
64+
struct bmcStorePot {
6565
uint8_t ports = 0;
6666
uint32_t event = 0;
6767
#if defined(BMC_USE_POT_TOE_SWITCH)
@@ -73,7 +73,7 @@
7373
#endif
7474
};
7575
// Encoder object
76-
struct __attribute__ ((packed)) bmcStoreEncoder {
76+
struct bmcStoreEncoder {
7777
uint8_t mode = 0;
7878
uint8_t ports = 0;
7979
uint32_t event = 0;
@@ -82,14 +82,14 @@
8282
#endif
8383
};
8484
// Led object, used by page leds, pwm leds, global Leds & pixels
85-
struct __attribute__ ((packed)) bmcStoreLed {
85+
struct bmcStoreLed {
8686
uint32_t event = 0;
8787
#if BMC_NAME_LEN_LEDS > 1
8888
char name[BMC_NAME_LEN_LEDS] = "";
8989
#endif
9090
};
9191
// RGB Led object, used by RGB Pixel maybe in the future by others
92-
struct __attribute__ ((packed)) bmcStoreRgbLed {
92+
struct bmcStoreRgbLed {
9393
uint32_t red = 0;
9494
uint32_t green = 0;
9595
uint32_t blue = 0;
@@ -98,24 +98,24 @@
9898
#endif
9999
};
100100
// OLED
101-
struct __attribute__ ((packed)) bmcStoreOled {
101+
struct bmcStoreOled {
102102
uint8_t type = 0;
103103
uint8_t value = 0;
104104
};
105105
// ILI
106-
struct __attribute__ ((packed)) bmcStoreIliBlock {
106+
struct bmcStoreIliBlock {
107107
uint8_t type = 0;
108108
uint8_t value = 0;
109109
};
110110
// Non-Latching Relay object
111-
struct __attribute__ ((packed)) bmcStoreGlobalRelay {
111+
struct bmcStoreGlobalRelay {
112112
uint32_t event = 0;
113113
#if BMC_NAME_LEN_RELAYS > 1
114114
char name[BMC_NAME_LEN_RELAYS] = "";
115115
#endif
116116
};
117117
// Page Object
118-
struct __attribute__ ((packed)) bmcStorePage {
118+
struct bmcStorePage {
119119
#if BMC_MAX_BUTTONS > 0
120120
bmcStoreButton buttons[BMC_MAX_BUTTONS];
121121
#endif
@@ -149,28 +149,28 @@
149149
};
150150

151151
// String Library object BMC_MAX_STRING_LIBRARY
152-
struct __attribute__ ((packed)) bmcStoreGlobalStringLibrary {
152+
struct bmcStoreGlobalStringLibrary {
153153
#if BMC_MAX_STRING_LIBRARY > 0
154154
char name[BMC_NAME_LEN_STRING_LIBRARY] = "";
155155
#endif
156156
};
157157
// Library object
158-
struct __attribute__ ((packed)) bmcStoreGlobalLibrary {
158+
struct bmcStoreGlobalLibrary {
159159
uint32_t event = 0;
160160
#if BMC_NAME_LEN_LIBRARY > 1
161161
char name[BMC_NAME_LEN_LIBRARY] = "";
162162
#endif
163163
};
164164
// Presets object
165-
struct __attribute__ ((packed)) bmcStoreGlobalPresets {
165+
struct bmcStoreGlobalPresets {
166166
uint8_t length = 0;
167167
bmcLibrary_t events[BMC_MAX_PRESET_ITEMS];
168168
#if BMC_NAME_LEN_PRESETS > 1
169169
char name[BMC_NAME_LEN_PRESETS] = "";
170170
#endif
171171
};
172172
// SetList Song object
173-
struct __attribute__ ((packed)) bmcStoreGlobalSetListSongPart {
173+
struct bmcStoreGlobalSetListSongPart {
174174
uint8_t length = 0;
175175
bmcPreset_t preset = 0;
176176
#if BMC_NAME_LEN_SETLIST_SONG_PART > 1
@@ -179,7 +179,7 @@
179179
};
180180
// SetList Song object
181181
//BMC_MAX_SETLISTS_SONGS_LIBRARY
182-
struct __attribute__ ((packed)) bmcStoreGlobalSetListSong {
182+
struct bmcStoreGlobalSetListSong {
183183
uint8_t settings = 0;
184184
uint8_t length = 0;
185185
bmcStoreGlobalSetListSongPart parts[BMC_MAX_SETLISTS_SONG_PARTS];
@@ -188,56 +188,56 @@
188188
#endif
189189
};
190190
// SetList object
191-
struct __attribute__ ((packed)) bmcStoreGlobalSetList {
191+
struct bmcStoreGlobalSetList {
192192
uint8_t length = 0;
193193
bmcPreset_t songs[BMC_MAX_SETLISTS_SONGS];
194194
#if BMC_NAME_LEN_SETLISTS > 1
195195
char name[BMC_NAME_LEN_SETLISTS] = "";
196196
#endif
197197
};
198198
// Custom SysEx object
199-
struct __attribute__ ((packed)) bmcStoreGlobalCustomSysEx {
199+
struct bmcStoreGlobalCustomSysEx {
200200
uint8_t length = 0;
201201
uint8_t event[16];
202202
};
203203
// Triggers, part of the global object
204-
struct __attribute__ ((packed)) bmcStoreGlobalTriggers {
204+
struct bmcStoreGlobalTriggers {
205205
uint32_t event = 0;
206206
uint32_t source = 0;
207207
};
208208
// Pot Calibration, part of the global object
209-
struct __attribute__ ((packed)) bmcStoreGlobalPotCalibration {
209+
struct bmcStoreGlobalPotCalibration {
210210
uint16_t min = 0;
211211
uint16_t max = 1023;
212212
};
213213
// Tempo To Tap object
214-
struct __attribute__ ((packed)) bmcStoreGlobalTempoToTap {
214+
struct bmcStoreGlobalTempoToTap {
215215
uint32_t event = 0;
216216
};
217217
// Port Presets
218-
struct __attribute__ ((packed)) bmcStorePortPresets {
218+
struct bmcStorePortPresets {
219219
uint8_t preset[16];
220220
};
221221
// Pixel Programs
222-
struct __attribute__ ((packed)) bmcStorePixelPrograms {
222+
struct bmcStorePixelPrograms {
223223
uint8_t length = 0;
224224
uint8_t events[8];
225225
};
226226
// Timed Events
227-
struct __attribute__ ((packed)) bmcStoreGlobalTimedEvents {
227+
struct bmcStoreGlobalTimedEvents {
228228
uint32_t event = 0;
229229
uint32_t timeout = 0;
230230
};
231231
// Settings object
232-
struct __attribute__ ((packed)) bmcStoreGlobalSettings {
232+
struct bmcStoreGlobalSettings {
233233
uint32_t flags = 0;
234234
uint32_t data[8];
235235
uint16_t routing[7];
236236
};
237237
// DO NOT CHANGE THIS ORDER!!!!!!!!!
238238
// This order is used to read/write from EEPROM to speed up the process
239239
// specially when using i2c.
240-
struct __attribute__ ((packed)) bmcStoreGlobal {
240+
struct bmcStoreGlobal {
241241
bmcStoreGlobalSettings settings;
242242
#if BMC_MAX_SKETCH_BYTES > 0
243243
uint8_t sketchBytes[BMC_MAX_SKETCH_BYTES];
@@ -295,7 +295,7 @@
295295
bmcStoreGlobalTimedEvents timedEvents[BMC_MAX_TIMED_EVENTS];
296296
#endif
297297
};
298-
struct __attribute__ ((packed)) bmcStore {
298+
struct bmcStore {
299299
uint16_t crc = 0;
300300
uint16_t version = 0;
301301
bmcStoreGlobal global;

0 commit comments

Comments
 (0)