Skip to content

Commit

Permalink
Fixed discrepancy between sensorCell structure and sensorCol/sensorRo…
Browse files Browse the repository at this point in the history
…w information, this now properly handles octave/transpose switch press at startup to enable low power mode, without showing the octave/transpose screen.
  • Loading branch information
gbevin committed May 17, 2016
1 parent aecf3a6 commit 1e84b3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions linnstrument-firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,7 @@ void reset() {
boolean switchPressAtStartup(byte switchRow) {
sensorCol = 0;
sensorRow = switchRow;
updateSensorCell();
// initially we need read Z a few times for the readings to stabilize
readZ(); readZ(); unsigned short switchZ = readZ();
if (switchZ > Device.sensorLoZ + 128) {
Expand Down Expand Up @@ -1067,6 +1068,7 @@ void setup() {
// default to performance mode
sensorCol = 0;
sensorRow = 0;
updateSensorCell();
{
operatingMode = modePerformance;

Expand Down
7 changes: 5 additions & 2 deletions ls_handleTouches.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,6 @@ inline void nextSensorCell() {

sensorCol = scannedCells[cellCount][0];
sensorRow = scannedCells[cellCount][1];
sensorSplit = getSplitOf(sensorCol);
if (++cellCount >= MAX_CELLCOUNT) {
cellCount = 0;
}
Expand All @@ -1541,8 +1540,12 @@ inline void nextSensorCell() {
}
}

sensorCell = &cell(sensorCol, sensorRow);
updateSensorCell();
}

inline void updateSensorCell() {
sensorSplit = getSplitOf(sensorCol);
sensorCell = &cell(sensorCol, sensorRow);
// we're keeping track of the state of X, Y and Z so that we don't refresh it needlessly for finger tracking
sensorCell->shouldRefreshData();
}
Expand Down

0 comments on commit 1e84b3a

Please sign in to comment.