Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4.0.1 #14

Merged
merged 26 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a66ade6
Merge branch 'v4.0.1-sip-puff' into v4.0.1
jversloot Apr 19, 2024
890b4f4
Added delay after initiating mode change and shows message
jversloot Apr 19, 2024
7279080
V4.0.1 - Bug Fix for Tiny USB Library version
jakemcivor Apr 23, 2024
deadec1
Merge branch 'v4.0.1-USB-Library' into v4.0.1
jakemcivor Apr 23, 2024
c034c41
Added timeout after no response from usb
jversloot Apr 23, 2024
3b67b24
Update LSConfig.h
jakemcivor Apr 24, 2024
7a0f42b
Update LSConfig.h
jakemcivor Apr 24, 2024
f055276
Update LSConfig.h
jakemcivor Apr 24, 2024
b02520a
Added menu timeout
jversloot Apr 24, 2024
490b8f9
Added timeout message
jversloot Apr 25, 2024
d3cafb3
Merge branch 'v4.0.1-usb-no-response-timeout' into v4.0.1
jversloot Apr 25, 2024
36a3863
Fixed bug
jversloot Apr 25, 2024
b7fb902
Merge pull request #12 from makersmakingchange/v4.0.1-lights
jakemcivor Apr 25, 2024
bb776c2
Fixed colours of onboard LED for operating mode
jversloot Apr 25, 2024
a6bf302
Update LSOutput.h
jversloot Apr 25, 2024
c086f6a
Update version number and clean up code
jversloot Apr 29, 2024
2b80164
Fixed default lights after drag or scroll
jversloot Apr 29, 2024
6d47afe
Updated version variables
jversloot Apr 30, 2024
9494b69
Update LSAPI.ino
jakemcivor May 1, 2024
c1805c1
Update LSMemory.h
jakemcivor May 1, 2024
df59de9
Update LSMemory.h
jakemcivor May 1, 2024
c238d9d
Update LSMemory.h
jakemcivor May 1, 2024
e2972f3
Merge branch '13-compiler-warnings' into v4.0.1
jakemcivor May 1, 2024
a55170d
Updated version number saving to memory
jversloot May 2, 2024
57944dc
Updated library version in Maker Guide
jversloot May 2, 2024
b8c2a10
Update CHANGES.txt
jversloot May 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 43 additions & 22 deletions Build_Files/Firmware_Files/LipSync_Firmware/LSAPI.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* File: LSAPI.h
* Firmware: LipSync
* Developed by: MakersMakingChange
* Version: v4.0.rc1 (26 January 2024)
* Version: v4.0.1 (29 April 2024)
License: GPL v3.0 or later

Copyright (C) 2024 Neil Squire Society
Expand Down Expand Up @@ -354,14 +354,41 @@ void getModelNumber(bool responseEnabled, bool apiEnabled, String optionalParame
//*********************************//
void getVersionNumber(bool responseEnabled, bool apiEnabled) {
String commandKey = "VN";
int tempVersionNumber = mem.readFloat(CONF_SETTINGS_FILE, commandKey);
if (tempVersionNumber != CONF_LIPSYNC_VERSION) { //If the previous firmware was different version then reset the settings
resetSettings(responseEnabled, apiEnabled);

int tempMajorVersionNumber = mem.readInt(CONF_SETTINGS_FILE, "VN1");
int tempMinorVersionNumber = mem.readInt(CONF_SETTINGS_FILE, "VN2");
int tempRevVersionNumber = mem.readInt(CONF_SETTINGS_FILE, "VN3");

if (tempMajorVersionNumber != CONF_LIPSYNC_VERSION_MAJOR) { //If the previous firmware was different version then reset the settings
// could add factory reset here if version number saved in memory is different
tempMajorVersionNumber = CONF_LIPSYNC_VERSION_MAJOR; //And store the version number
mem.writeInt(CONF_SETTINGS_FILE, "VN1", tempMajorVersionNumber);

tempMinorVersionNumber = CONF_LIPSYNC_VERSION_MINOR; //And store the version number
mem.writeInt(CONF_SETTINGS_FILE, "VN2", tempMinorVersionNumber);

tempRevVersionNumber = CONF_LIPSYNC_VERSION_REV; //And store the version number
mem.writeInt(CONF_SETTINGS_FILE, "VN3", tempRevVersionNumber);
}

else if (tempMinorVersionNumber != CONF_LIPSYNC_VERSION_MINOR) { //If the previous firmware was different version then reset the settings
// could reset some settings here if version number saved in memory is different
tempMinorVersionNumber = CONF_LIPSYNC_VERSION_MINOR; //And store the version number
mem.writeInt(CONF_SETTINGS_FILE, "VN2", tempMinorVersionNumber);

tempRevVersionNumber = CONF_LIPSYNC_VERSION_REV; //And store the version number
mem.writeInt(CONF_SETTINGS_FILE, "VN3", tempRevVersionNumber);
}

tempVersionNumber = CONF_LIPSYNC_MODEL; //And store the version number
mem.writeFloat(CONF_SETTINGS_FILE, commandKey, tempVersionNumber);
else if (tempRevVersionNumber != CONF_LIPSYNC_VERSION_REV) { //If the previous firmware was different version then reset the settings
tempRevVersionNumber = CONF_LIPSYNC_VERSION_REV; //And store the version number
mem.writeInt(CONF_SETTINGS_FILE, "VN3", tempRevVersionNumber);
}
printResponseFloat(responseEnabled, apiEnabled, true, 0, "VN,0", true, tempVersionNumber);


String tempLipsyncVersionStr = String(tempMajorVersionNumber) + "." + String(tempMinorVersionNumber) + "." + String(tempRevVersionNumber);

printResponseString(responseEnabled, apiEnabled, true, 0, "VN,0", true, tempLipsyncVersionStr);
}
//***GET VERSION API FUNCTION***//
// Function : getVersionNumber
Expand Down Expand Up @@ -1051,24 +1078,18 @@ void getJoystickValue(bool responseEnabled, bool apiEnabled, String optionalPara
//*********************************//
void getPressureValue(bool responseEnabled, bool apiEnabled) {

ps.update(); //Request new values from pressure class
ps.update(); // Request new values from pressure class

int outputArraySize = 3;
float tempPressureArray[outputArraySize];

float tempSapPressure[3];
tempSapPressure[0] = ps.getSapPressureAbs(); //Read the main pressure
tempSapPressure[1] = ps.getAmbientPressure(); //Read the ref pressure
tempSapPressure[2] = ps.getSapPressure(); //Read the diff pressure
int outputArraySize = 3;
float tempSapPressure[outputArraySize];
tempSapPressure[0] = ps.getSapPressureAbs(); // Read the main pressure
tempSapPressure[1] = ps.getAmbientPressure(); // Read the ref pressure
tempSapPressure[2] = ps.getSapPressure(); // Read the diff pressure


printResponseFloatArray(responseEnabled, apiEnabled, true, 0, "PV,0", true, "", outputArraySize, ',', tempPressureArray);


//float tempPressureValue = (float) ps.getSapPressure();
//printResponseFloat(responseEnabled, apiEnabled, true, 0, "PV,0", true, tempPressureValue);

printResponseFloatArray(responseEnabled, apiEnabled, true, 0, "PV,0", true, "", outputArraySize, ',', tempSapPressure);
}

//***GET PRESSURE VALUE API FUNCTION***//
// Function : getPressureValue
//
Expand Down Expand Up @@ -2304,4 +2325,4 @@ void printResponseFloatPointArray(bool responseEnabled, bool apiEnabled, bool re

printResponseString(responseEnabled, apiEnabled, responseStatus, responseNumber, responseCommand, responseParameterEnabled, responseParameterString);

}
}
2 changes: 1 addition & 1 deletion Build_Files/Firmware_Files/LipSync_Firmware/LSBLE.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* File: LSBLE.h
* Firmware: LipSync
* Developed by: MakersMakingChange
* Version: v4.0.rc1 (26 January 2024)
* Version: v4.0.1 (29 April 2024)
License: GPL v3.0 or later

Copyright (C) 2024 Neil Squire Society
Expand Down
6 changes: 3 additions & 3 deletions Build_Files/Firmware_Files/LipSync_Firmware/LSBuzzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* File: LSBuzzer.h
* Firmware: LipSync
* Developed by: MakersMakingChange
* Version: v4.0.rc1 (26 January 2024)
* Version: v4.0.1 (29 April 2024)
License: GPL v3.0 or later

Copyright (C) 2024 Neil Squire Society
Expand Down Expand Up @@ -113,7 +113,7 @@

class LSBuzzer {
private:
boolean _buzzerOn = true; // TODO: make this something that is saved in memory and not saved just here, then load from memory instead of setting to true;
boolean _buzzerOn = true; // TODO: do we need this variable or is just soundModeLevel enough?
int _soundModeLevel;

public:
Expand All @@ -134,7 +134,7 @@ LSBuzzer::LSBuzzer() {

void LSBuzzer::begin(){
pinMode(CONF_BUZZER_PIN, OUTPUT);
//TODO: check if sound is emabled by reading from memory
// Read sound mode level from memory
_soundModeLevel = getSoundMode(false, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* File: LSCircularBuffer.h
* Firmware: LipSync
* Developed by: MakersMakingChange
* Version: v4.0.rc1 (26 January 2024)
* Version: v4.0.1 (29 April 2024)
License: GPL v3.0 or later

Copyright (C) 2024 Neil Squire Society
Expand Down
67 changes: 39 additions & 28 deletions Build_Files/Firmware_Files/LipSync_Firmware/LSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* File: LSConfig.h
* Firmware: LipSync
* Developed by: MakersMakingChange
* Version: v4.0.rc1 (26 January 2024)
* Version: v4.0.1 (29 April 2024)
License: GPL v3.0 or later

Copyright (C) 2024 Neil Squire Society
Expand All @@ -24,7 +24,12 @@

//***DO NOT CHANGE***//
#define CONF_LIPSYNC_MODEL 1 // 1: Lipsync w/ Hub
#define CONF_LIPSYNC_VERSION 4

#define CONF_LIPSYNC_VERSION_MAJOR 4
#define CONF_LIPSYNC_VERSION_MINOR 0
#define CONF_LIPSYNC_VERSION_REV 1

const String lipsyncVersionStr = String(CONF_LIPSYNC_VERSION_MAJOR) + "." + String(CONF_LIPSYNC_VERSION_MINOR) + "." + String(CONF_LIPSYNC_VERSION_REV);

//Input pins
#define CONF_BUTTON1_PIN 9 // Pushbutton S1
Expand Down Expand Up @@ -126,32 +131,33 @@
#define CONF_ACTION_NOTHING 0 // No action
#define CONF_ACTION_LEFT_CLICK 1 // Generates a short left click
#define CONF_ACTION_RIGHT_CLICK 2 // Generates a short right click
#define CONF_ACTION_DRAG 3 // Initiates drag mode, holding down left click until cancelled
#define CONF_ACTION_SCROLL 4 // Initiates scroll mode. Vertical motion generates mouse scroll wheel movement.
#define CONF_ACTION_CURSOR_CENTER 5 // Center the joystick
#define CONF_ACTION_CURSOR_CALIBRATION 6 // Initiates the joystick calibration.
#define CONF_ACTION_MIDDLE_CLICK 7 // Generates a short middle click
#define CONF_ACTION_DEC_SPEED 8 // Decrease cursor movement speed
#define CONF_ACTION_INC_SPEED 9 // Increase cursor movement speed
#define CONF_ACTION_CHANGE_MODE 10 // Change communication mode
#define CONF_ACTION_START_MENU 11 // Start menu on display
#define CONF_ACTION_STOP_MENU 12 // Close menu on display
#define CONF_ACTION_B1_PRESS 13 // Generates a Button 1 press or button X1(Left USB)/View(Right USB) press in XAC
#define CONF_ACTION_B2_PRESS 14 // Generates a Button 2 press or button X2(Left USB)/Menu(Right USB) press in XAC
#define CONF_ACTION_B3_PRESS 15 // Generates a Button 3 press or button LS(Left USB)/RS(Right USB) press in XAC
#define CONF_ACTION_B4_PRESS 16 // Generates a Button 4 press or button LB(Left USB)/RB(Right USB) press in XAC
#define CONF_ACTION_B5_PRESS 17 // Generates a Button 5 press or button A(Left USB)/X(Right USB) press in XAC
#define CONF_ACTION_B6_PRESS 18 // Generates a Button 6 press or button B(Left USB)/Y(Right USB) press in XAC
#define CONF_ACTION_B7_PRESS 19 // Generates a Button 7 press or button View(Left USB)/X1(Right USB) press in XAC
#define CONF_ACTION_B8_PRESS 20 // Generates a Button 8 press or button Menu(Left USB)/X2(Right USB) press in XAC
#define CONF_ACTION_MIDDLE_CLICK 3 // Generates a short middle click
#define CONF_ACTION_DRAG 4 // Initiates drag mode, holding down left click until cancelled
#define CONF_ACTION_SCROLL 5 // Initiates scroll mode. Vertical motion generates mouse scroll wheel movement.
#define CONF_ACTION_B1_PRESS 6 // Generates a Button 1 press or button X1(Left USB)/View(Right USB) press in XAC
#define CONF_ACTION_B2_PRESS 7 // Generates a Button 2 press or button X2(Left USB)/Menu(Right USB) press in XAC
#define CONF_ACTION_B3_PRESS 8 // Generates a Button 3 press or button LS(Left USB)/RS(Right USB) press in XAC
#define CONF_ACTION_B4_PRESS 9 // Generates a Button 4 press or button LB(Left USB)/RB(Right USB) press in XAC
#define CONF_ACTION_B5_PRESS 10 // Generates a Button 5 press or button A(Left USB)/X(Right USB) press in XAC
#define CONF_ACTION_B6_PRESS 11 // Generates a Button 6 press or button B(Left USB)/Y(Right USB) press in XAC
#define CONF_ACTION_B7_PRESS 12 // Generates a Button 7 press or button View(Left USB)/X1(Right USB) press in XAC
#define CONF_ACTION_B8_PRESS 13 // Generates a Button 8 press or button Menu(Left USB)/X2(Right USB) press in XAC
#define CONF_ACTION_CURSOR_CENTER 14 // Center the joystick
#define CONF_ACTION_CURSOR_CALIBRATION 15 // Initiates the joystick calibration.
#define CONF_ACTION_DEC_SPEED 16 // Decrease cursor movement speed
#define CONF_ACTION_INC_SPEED 17 // Increase cursor movement speed
#define CONF_ACTION_CHANGE_MODE 18 // Change communication mode
#define CONF_ACTION_START_MENU 19 // Start menu on display
#define CONF_ACTION_STOP_MENU 20 // Close menu on display
#define CONF_ACTION_NEXT_MENU_ITEM 21 // Move to next item in menu
#define CONF_ACTION_SELECT_MENU_ITEM 22 // Select current item in menu
#define CONF_ACTION_RESET 23 // Software Reset
#define CONF_ACTION_FACTORY_RESET 24 // Factory Reset


//Flash Memory settings - Don't change
#define CONF_SETTINGS_FILE "/settings.txt"
#define CONF_SETTINGS_JSON "{\"MN\":0,\"VN\":0.0,\"OM\":1,\"CM\":1,\"SS\":5,\"SL\":5,\"PM\":2,\"ST\":0.0,\"PT\":0.0,\"AV\":0,\"DZ\":0.0,\"CA0\":[0.0,0.0],\"CA1\":[13.0,13.0],\"CA2\":[-13.0,13.0],\"CA3\":[-13.0,-13.0],\"CA4\":[13.0,-13.0],\"SM\":1,\"DM\":0}"
#define CONF_SETTINGS_JSON "{\"MN\":0,\"VN1\":4,\"VN2\":0,\"VN3\":1,\"OM\":1,\"CM\":1,\"SS\":5,\"SL\":5,\"PM\":2,\"ST\":0.0,\"PT\":0.0,\"AV\":0,\"DZ\":0.0,\"CA0\":[0.0,0.0],\"CA1\":[13.0,13.0],\"CA2\":[-13.0,13.0],\"CA3\":[-13.0,-13.0],\"CA4\":[13.0,-13.0],\"SM\":1,\"DM\":0}"

//Polling rates for each module
#define CONF_JOYSTICK_POLL_RATE 50 //50ms - Measure,
Expand All @@ -167,6 +173,9 @@

#define CONF_SPLASH_SCREEN_DURATION 10000 //10 seconds - how long the splash screen stays on on startup

#define CONF_MENU_TIMEOUT 300000 // 300 seconds (5 minutes) - duration of inactivity after which the screen turns off
#define CONF_USB_HID_TIMEOUT 5000 //5 seconds - timeout for connecting to USB and defaulting to Bluetooth instead

// Polling Timer IDs for each module
#define CONF_TIMER_JOYSTICK 0
#define CONF_TIMER_PRESSURE 1
Expand Down Expand Up @@ -401,17 +410,19 @@ const ledActionStruct ledActionProperty[]{
{ CONF_ACTION_NOTHING, CONF_LED_NONE, LED_CLR_NONE, LED_CLR_NONE, LED_ACTION_NONE },
{ CONF_ACTION_LEFT_CLICK, CONF_LED_LEFT, LED_CLR_NONE, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_RIGHT_CLICK, CONF_LED_RIGHT, LED_CLR_NONE, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_DRAG, CONF_LED_LEFT, LED_CLR_RED, LED_CLR_RED, LED_ACTION_ON },
{ CONF_ACTION_SCROLL, CONF_LED_RIGHT, LED_CLR_RED, LED_CLR_RED, LED_ACTION_ON },
{ CONF_ACTION_MIDDLE_CLICK, CONF_LED_MIDDLE, LED_CLR_NONE, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_DRAG, CONF_LED_LEFT, LED_CLR_RED, LED_CLR_RED, LED_ACTION_ON },
{ CONF_ACTION_SCROLL, CONF_LED_RIGHT, LED_CLR_RED, LED_CLR_RED, LED_ACTION_ON },
{ CONF_ACTION_B1_PRESS, CONF_LED_LEFT, LED_CLR_NONE, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_B2_PRESS, CONF_LED_RIGHT, LED_CLR_NONE, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_B3_PRESS, CONF_LED_RIGHT, LED_CLR_NONE, LED_CLR_NONE, LED_ACTION_NONE },
{ CONF_ACTION_B4_PRESS, CONF_LED_NONE, LED_CLR_NONE, LED_CLR_NONE, LED_ACTION_NONE },
{ CONF_ACTION_B5_PRESS, CONF_LED_NONE, LED_CLR_NONE, LED_CLR_NONE, LED_ACTION_NONE },
{ CONF_ACTION_B6_PRESS, CONF_LED_NONE, LED_CLR_NONE, LED_CLR_NONE, LED_ACTION_NONE },
{ CONF_ACTION_B3_PRESS, CONF_LED_LEFT, LED_CLR_NONE, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_B4_PRESS, CONF_LED_RIGHT, LED_CLR_NONE, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_B5_PRESS, CONF_LED_MIDDLE, LED_CLR_NONE, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_B6_PRESS, CONF_LED_MIDDLE, LED_CLR_NONE, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_B7_PRESS, CONF_LED_NONE, LED_CLR_NONE, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_B8_PRESS, CONF_LED_NONE, LED_CLR_NONE, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_CURSOR_CENTER, CONF_LED_MICRO, LED_CLR_PURPLE, LED_CLR_NONE, LED_ACTION_NONE },
{ CONF_ACTION_CURSOR_CALIBRATION, CONF_LED_MICRO, LED_CLR_PURPLE, LED_CLR_NONE, LED_ACTION_ON },
{ CONF_ACTION_MIDDLE_CLICK, CONF_LED_MIDDLE, LED_CLR_NONE, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_DEC_SPEED, CONF_LED_LEFT, LED_CLR_RED, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_INC_SPEED, CONF_LED_RIGHT, LED_CLR_RED, LED_CLR_RED, LED_ACTION_BLINK },
{ CONF_ACTION_CHANGE_MODE, CONF_LED_NONE, LED_CLR_NONE, LED_CLR_NONE, LED_ACTION_NONE },
Expand Down
2 changes: 1 addition & 1 deletion Build_Files/Firmware_Files/LipSync_Firmware/LSInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* File: LSInput.h
* Firmware: LipSync
* Developed by: MakersMakingChange
* Version: v4.0.rc1 (26 January 2024)
* Version: v4.0.1 (29 April 2024)
License: GPL v3.0 or later

Copyright (C) 2024 Neil Squire Society
Expand Down
2 changes: 1 addition & 1 deletion Build_Files/Firmware_Files/LipSync_Firmware/LSJoystick.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* File: LSJoystick.h
* Firmware: LipSync
* Developed by: MakersMakingChange
* Version: v4.0.rc1 (26 January 2024)
* Version: v4.0.1 (29 April 2024)
License: GPL v3.0 or later

Copyright (C) 2024 Neil Squire Society
Expand Down
Loading