Skip to content

Commit

Permalink
v0.0.17 updated Typer
Browse files Browse the repository at this point in the history
  • Loading branch information
neroroxxx committed Aug 25, 2020
1 parent 9c256fb commit e0ac007
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 31 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=BMC
version=0.0.16
version=0.0.17
author=Nero Rox
maintainer=Nero Rox <info@roxxxtar.com>
sentence=Badass MIDI Controller (BMC), a fully featured MIDI Controller with a Desktop Editor App. For 32-bit Teensy Only
Expand Down
2 changes: 1 addition & 1 deletion src/BMC-Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// BMC Version stored in EEPROM (for editor usage)
#define BMC_VERSION_MAJ 0
#define BMC_VERSION_MIN 0
#define BMC_VERSION_PATCH 16
#define BMC_VERSION_PATCH 17

//16 bits unsigned, LSB byte is minor, MSB byte is major
#define BMC_VERSION ((BMC_VERSION_MAJ<<8) | BMC_VERSION_MIN)
Expand Down
8 changes: 2 additions & 6 deletions src/BMC.editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ void BMC::assignStoreData(){
}
}
void BMC::assignSettings(){
/*
Set the global settings
*/
// Set the global settings
valueTyper.setOffset(settings.getTyperOffSet());
midiClock.setMaster(settings.getMasterClock());
midiActiveSense.setOutputPorts(settings.getListenerPorts());
midi.setListenerEnable(settings.getIncomingListenerEnabled());
Expand All @@ -92,10 +91,7 @@ void BMC::assignSettings(){
midi.setClockListenerPort(settings.getClockInputPortBit());
editor.setChainingPort(settings.getChainingPort());

valueTyper.setOffset(settings.getTyperOffSet());

midi.setRouting(BMC_USB, settings.getUsbRouting());

#ifdef BMC_MIDI_SERIAL_A_ENABLED
midi.setRouting(BMC_SERIAL_A, settings.getSerialARouting());
#endif
Expand Down
16 changes: 8 additions & 8 deletions src/BMC.hardware.buttons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,21 +724,21 @@ void BMC::handleGlobalButton(uint8_t index, uint8_t t_trigger){
if(cmd==12){// page
setPage(valueTyper.getRawOutput());
} else if(cmd==13){// preset
#if BMC_MAX_PRESETS > 0
#if BMC_MAX_PRESETS > 0
presets.set(valueTyper.getRawOutput());
#endif
#endif
} else if(cmd==14){// fas preset
#if defined(BMC_USE_FAS)
#if defined(BMC_USE_FAS)
fas.setPreset(valueTyper.getRawOutput());
#endif
#endif
} else if(cmd==15){// fas scene
#if defined(BMC_USE_FAS)
#if defined(BMC_USE_FAS)
fas.setSceneNumber(valueTyper.getRawOutput(), false);
#endif
#endif
} else if(cmd==16){// fas scene revert
#if defined(BMC_USE_FAS)
#if defined(BMC_USE_FAS)
fas.setSceneNumber(valueTyper.getRawOutput(), true);
#endif
#endif
}
}
}
Expand Down
15 changes: 8 additions & 7 deletions src/utility/BMC-Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
bit 5 getActiveSenseAtStartup - Active Sensing Master Enabled
bit 6 getMidiRealTimeBlockInput
bit 7 getMidiRealTimeBlockOutput
bit 8 getTyperOffSet
Expand Down Expand Up @@ -146,6 +147,13 @@ class BMCSettings {
void setMidiRealTimeBlockOutput(bool value){
writeFlag(7,value);
}
// typer offset to 0
uint8_t getTyperOffSet(){
return readFlag(8);
}
void setTyperOffSet(bool value){
writeFlag(8, value);
}



Expand Down Expand Up @@ -187,13 +195,6 @@ class BMCSettings {
void setPwmDimWhenOff(uint8_t value){
bitWrite(settings.data[0],18,value);
}
// typer offset to 0
uint8_t getTyperOffSet(){
return (settings.data[0]>>19) & 0x01;
}
void setTyperOffSet(uint8_t value){
bitWrite(settings.data[0], 19, value);
}
// store address
uint8_t getStoreAddress(){
return (settings.data[0]>>20) & 0x03;
Expand Down
14 changes: 6 additions & 8 deletions src/utility/BMC-Typer.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,16 @@ class BMCTyper {
}
// return the raw value used by the output
uint16_t getRawOutput(){
if(flags.read(BMC_TYPER_FLAG_DISPLAY_ZERO_OFFSET)){
if(!flags.read(BMC_TYPER_FLAG_DISPLAY_ZERO_OFFSET)){
return (output==0) ? 0 : (output-1);
}
return output;
}
void setOffset(bool value){
if(flags.read(BMC_TYPER_FLAG_DISPLAY_ZERO_OFFSET) != value){
vtValue = 0;
vtCount = 0;
output = 0;
}
flags.write(BMC_TYPER_FLAG_DISPLAY_ZERO_OFFSET, value);
void setOffset(bool t_value){
vtValue = 0;
vtCount = 0;
output = 0;
flags.write(BMC_TYPER_FLAG_DISPLAY_ZERO_OFFSET, t_value);
}
uint8_t cmd(uint8_t value, uint8_t autoTrigger=0){
if(value >= 10){
Expand Down

0 comments on commit e0ac007

Please sign in to comment.