Compare commits

...

5 Commits

Author SHA1 Message Date
Sascha Nitsch d133664567 profile for PulseView 2022-03-22 06:56:33 +01:00
Sascha Nitsch 09205709c1 fixed indent 2022-03-22 06:56:16 +01:00
Sascha Nitsch 0d516f0da3 reset error message on start 2022-03-22 06:55:55 +01:00
Sascha Nitsch 2f15ae8681 fixed comments 2022-03-22 06:55:28 +01:00
Sascha Nitsch e4d0c779aa raised max size for external EEPROM 2022-03-22 06:55:00 +01:00
6 changed files with 124 additions and 4 deletions

View File

@ -69,7 +69,6 @@ const char protectString[] = "cimdit:";
/// current position in protection string
uint8_t protectPos = 0;
/// main loop
void loop() {
hal.readFromHardware(outstandingRotInterrupt);
@ -118,7 +117,7 @@ void loop() {
case 'f': // read flash
profile.printFlash();
break;
case 'F': // write flash
case 'F': // write flash
profile.writeFlash();
break;
}

View File

@ -675,7 +675,11 @@ void CimditProfile::printFlash() {
m_eepromPosition = 0;
uint16_t len = nextUInt16();
m_eepromPosition = 0;
#ifdef EXTERNAL_EEPROM
if (len < 32768) {
#else
if (len < 1024) {
#endif
uint8_t in;
for (uint16_t i = 0; i < len; ++i) {
in = nextUInt8();
@ -707,11 +711,12 @@ void CimditProfile::writeFlash() {
#ifdef EXTERNAL_EEPROM
eepromWrite(m_eepromPosition++, len >> 8);
eepromWrite(m_eepromPosition++, len & 255);
if (len < 32768) {
#else
EEPROM.write(m_eepromPosition++, len >> 8);
EEPROM.write(m_eepromPosition++, len & 255);
#endif
if (len < 1024) {
#endif
for (uint16_t i = 2; i < len; ++i) {
while ((buf[0] = Serial.read()) == -1) {
delay(100);
@ -729,6 +734,9 @@ void CimditProfile::writeFlash() {
Serial.println("written");
initProfiles();
}
m_displayState = DISPLAY_BLANK; // to enforce a redraw
showActiveProfile();
return false;
}
void CimditProfile::setUserString(uint8_t timeout, const char* input) {

View File

@ -284,7 +284,13 @@ class CimditProfile {
/// timeout of submitted string
uint32_t m_userTimeout;
float m_relMouseX, m_relMouseY;
/// relative mouse movement X
float m_relMouseX;
/// relative mouse movement Y
float m_relMouseY;
/// offset of custom image
uint16_t m_customImage;
};

View File

@ -322,6 +322,7 @@ class ProfileGenerator {
event.preventDefault();
var input = this.json.value;
var json = {};
this.error.innerHTML = "";
try {
json = JSON.parse(input);
} catch (e) {

View File

@ -498,6 +498,7 @@ var ProfileGenerator = (function () {
event.preventDefault();
var input = this.json.value;
var json = {};
this.error.innerHTML = "";
try {
json = JSON.parse(input);
}

105
profiles/pulseview.txt Normal file
View File

@ -0,0 +1,105 @@
Profile for PulseView, a "portable, cross-platform, Free/Libre/Open-Source signal analysis software suite" sigrok.org
Support for horizontal and vertical scrolling and zoom using rotary encoders.
Push buttons for start/stop recording (button 46), cursors (button 38), fit recording to screen (button 14, on rotary encoder for zoom)
Includes PulseView Logo.
JSON:
{
"name": "PulseView",
"customimage": "000000000000000DB000000000000000000000000000004DB200000000000000000000000000004DB200000000000000000000000000046DB6200000000000000000000000000665A6600000000000000000000000000335ACC00000000000000000000000000337ECC000000000000000000000000061B7ED8600000000000000000000000071FFFF8E00000000000000000000000038DFFB1C0000000000000000000000001EFFFF78000000000000000000000000077FFEE000000000000000000000000003BFFDC000000000000000000000000001FFFF8000000000000000000000000000FFFF00000000000000000000000000007FFE00000000000000000000000000003FFC00000000000000000000000000001FF800000000000000000000000000000FF000000000000000000000000000000FF000000000000000000000000000000FF000000000000000000000000000000FF000000000000000000000000000003FFC00000000000000000000000000007FFE00000000000000000000000000007FFE0000000000000000000000000000FFFF0000000000000000000000000000FFFF0000000000000000000000000000FFFF0000000000000000000000000000FFFF0000000000000000000000000000FFFF00000000000000000000000000007FFF00000000000000000000000000007FFE00000000000000",
"mappedbuttons": [
{
"source": 62,
"type": "SWITCH_PROFILE"
},
{
"source": 46,
"type": "KEYBOARD_BUTTON",
"target": "KEY_SPACE"
},
{
"source": 38,
"type": "KEYBOARD_BUTTON",
"target": "KEY_C"
},
{
"source": 14,
"type": "KEYBOARD_BUTTON",
"target": "KEY_F"
}
],
"mappedaxis": [],
"mappedrotary": [
{
"source": 0,
"type": "PREV_PROFILE"
},
{
"source": 1,
"type": "NEXT_PROFILE"
},
{
"source": 10,
"type": "MOUSE_REL_WHEEL",
"value": 1
},
{
"source": 11,
"type": "MOUSE_REL_WHEEL",
"value": 1
},
{
"source": 12,
"type": "MACRO_PRESS",
"macro": 0
},
{
"source": 13,
"type": "MACRO_PRESS",
"macro": 1
},
{
"source": 14,
"type": "MACRO_PRESS",
"macro": 2
},
{
"source": 15,
"type": "MACRO_PRESS",
"macro": 3
}
],
"macros": [
[
"MACRO_KEY_PRESS",
"KEY_LEFT_ALT",
"MACRO_MOUSE_WHEEL",
-1,
"MACRO_KEY_RELEASE",
"KEY_LEFT_ALT"
],
[
"MACRO_KEY_PRESS",
"KEY_LEFT_ALT",
"MACRO_MOUSE_WHEEL",
1,
"MACRO_KEY_RELEASE",
"KEY_LEFT_ALT"
],
[
"MACRO_KEY_PRESS",
"KEY_LEFT_CTRL",
"MACRO_MOUSE_WHEEL",
1,
"MACRO_KEY_RELEASE",
"KEY_LEFT_CTRL"
],
[
"MACRO_KEY_PRESS",
"KEY_LEFT_CTRL",
"MACRO_MOUSE_WHEEL",
-1,
"MACRO_KEY_RELEASE",
"KEY_LEFT_CTRL"
]
]
}