Skip to content

Commit

Permalink
Merge branch 'release/0.29.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
stylesuxx committed Feb 23, 2023
2 parents e23a3e0 + 80b9d1a commit 62b0268
Show file tree
Hide file tree
Showing 48 changed files with 425 additions and 40 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esc-configurator",
"version": "0.28.1",
"version": "0.29.0",
"private": false,
"license": "AGPL-3.0",
"dependencies": {
Expand Down
8 changes: 7 additions & 1 deletion src/Components/Flash/CommonSettings/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,15 @@ function CommonSettings({
setting = settingOverride;
}
}
const value = availableSettings[setting.name];
const hint = i18n.exists(`hints:${setting.name}`) ? t(`hints:${setting.name}`) : null;

// Sanitize a value if it is depended on another value
let value = availableSettings[setting.name];
if (description.sanitize) {
value = description.sanitize(value, availableSettings);
availableSettings[setting.name] = value;
}

switch (setting.type) {
case 'bool': {
return (
Expand Down
48 changes: 47 additions & 1 deletion src/Containers/App/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import i18next from 'i18next';
import BinToHex from 'bin-to-hex';

import { fetchHexCached } from '../../utils/Fetch';
import { TimeoutError } from '../../utils/helpers/QueueProcessor';
import { getMasterSettings } from '../../utils/helpers/Settings';
import { delay } from '../../utils/helpers/General';
import MainApp from '../../Components/App';
Expand All @@ -22,6 +23,7 @@ import {
loadSerialApi,
loadSettings,
} from '../../utils/LocalStorage';
import { MessageNotOkError } from '../../utils/Errors';

const {
availableLanguages,
Expand Down Expand Up @@ -440,6 +442,18 @@ class App extends Component {
let connected = 0;

this.setActions({ isReading: true });

// Prevent reading if radio is detected to be on and not connected yet
if(!escs.connected) {
const status = await this.serial.getStatus();
if(!status.armingDisableFlagsReasons.RX_FAILSAFE) {
this.addLogMessage('radioOn');
this.setActions({ isReading: false });

return;
}
}

try {
if(this.lastConnected === 0) {
const escs = await this.serial.enable4WayInterface();
Expand Down Expand Up @@ -767,7 +781,39 @@ class App extends Component {
}

try {
const apiVersion = await this.serial.getApiVersion();
let apiVersion = null;

try {
apiVersion = await this.serial.getApiVersion();
} catch(e) {
if (e instanceof TimeoutError) {
let hasResets = false;
let i = 0;

try {
while ((await this.serial.getFourWayInterfaceInfo(i))) {
await this.serial.resetFourWayInterface(i);
i += 1;
}
} catch (ex) {
if (!(ex instanceof MessageNotOkError)) {
this.addLogMessage('resetEscFailedPowerCycle', { index: i + 1 });
throw ex;
}
} finally {
hasResets = i > 0;
}

if (hasResets) {
await this.serial.exitFourWayInterface();
}

apiVersion = await this.serial.getApiVersion();
} else {
throw e;
}
}

this.addLogMessage('mspApiVersion', { version: apiVersion.apiVersion });

const fcVariant = await this.serial.getFcVariant();
Expand Down
10 changes: 10 additions & 0 deletions src/changelog.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
[
{
"title": "0.29.0",
"items": [
"Enhancement: More melodies",
"Enhancement: Detect if FC is in 4 way interface mode after reconnection and reset",
"Enhancement: Detect if radio is on and do not allow reading/flashing",
"Bluejay: New layout including pwm settings",
"Bluejay: New layout including power settings"
]
},
{
"title": "0.28.1",
"items": [
Expand Down
42 changes: 42 additions & 0 deletions src/melodies.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@
"jingle4:b=200,o=5,d=4:d,32p,8d,32p,8d,p,c#,32p,8c#,32p,8c#,p,d,32p,8e,32p,a4,32p,8b4,32p,c,32p,8b4,64p,a4,32p,8g4,32p,2f#4"
]
},
{
"name":"The Chemical Brothers - Galvanize",
"tracks": [
"Galvanize:d=16,o=3,b=104:8f,p,8f,p,8g,p,g5,4p,a#,8p,8a,8p,8g#",
"Galvanize:d=16,o=4,b=104:8f,p,8f,p,8g,8p,g,p,a,p,c5,a#,p,a#,a,a#,g,a,f",
"Galvanize:d=16,o=3,b=104:8b,p,8b,p,8b,8p,g5,p,a5,p,c6,a#5,p,a#5,a5,a#5,g5,a5,f5",
"Galvanize:d=16,o=3,b=104:8g,p,8g,p,8g,p,g5,4p,a#,8p,8a,8p,8g#"
]
},
{
"name": "Chiquitita - Abba",
"tracks": [
Expand Down Expand Up @@ -171,6 +180,12 @@
"ievan_polkka_3:o=5,b=100,d=8:p,32f#.,64p,32f#.,64p,p,f#,p,f#,p,f#,p,32f.,64p,32f.,64p,p,f,p,f#,p,f#"
]
},
{
"name": "Maxwell the cat Theme",
"tracks": [
"maxwell:d=32, f=16:d5,p,d5,p,d5,p,e5,p,f5,p,p,p,f5,p,p,p,b5,p,b5,p,b5,p,a5,p,g5,p,p,p,g5,p,p,p,c5,c5,c5,c5,c5,c5,p,a4,a4,a4,a4,a4,a4,p,e5,e5,e5,e5,e5,e5,p,c5,c5,c5,c5,c5,c5."
]
},
{
"name": "Mobilnik - Sergey Shnurov",
"tracks": [
Expand Down Expand Up @@ -210,6 +225,15 @@
"never4:b=210,o=3,d=4:8d4,8e4,8g4,8d4,c4,c4,c4,d4,8p,8d4,8e4,8p,8g4,8p,8a4,8p,b4,b4,b4,e4,8e4,8f#4,8e4,8p,8d4,8e4,8g4,8e4,2a4,a4,2d5,8a4,8p,8d4,8p,8a4,8p,2f#4,2e4"
]
},
{
"name": "Owl City - Fireflies",
"tracks": [
"Fireflies1:d=8,o=5,b=180:a#3,a#4,d6,a#3,a#4,a#5,p,d#,d#4,a#,f,d#,f,a#,p,d#,g#3,c,a#,c,d#,d#4,g#3,p,a#,c,a#,c4,a#,d#,f,a#3,a#4,d6,d,f4,a#,p,d#,d#4,a#4,f,d#,g#,g,d#,a#4,g#3,c,d#4,g#3,a#4,p,d#4,c,g#3,c,a#4,c4,d#,f",
"Fireflies2:d=8,o=4,b=180:4p,a#3,f.,16p,4f,d#,4f,4d#,4a#3,4p,4p,a#3,c.,16p,4c,a#3,4c,4d#,4f.,4p,4g,4f,d#,a#3.,16p,16a#3.,32p,4a#3,f,4d#,4c,1p,2p",
"Fireflies3:d=8,o=4,b=180:4p,a#3,f.,16p,4f,d#,4f,4d#,4a#3,4p,4p,a#3,c.,16p,4c,a#3,4c,4d#,4f.,4p,4g,4f,d#,a#3.,16p,16a#3.,32p,4a#3,f,4d#,4c,1p,2p",
"Fireflies4:d=8,o=4,b=180:4p,a#3,f.,16p,4f,d#,4f,4d#,4a#3,4p,4p,a#3,c.,16p,4c,a#3,4c,4d#,4f.,4p,4g,4f,d#,a#3.,16p,16a#3.,32p,4a#3,f,4d#,4c,1p,2p"
]
},
{
"name": "Pacman Theme",
"tracks": [
Expand Down Expand Up @@ -285,6 +309,15 @@
"SouthHeaven:b=108,o=5,d=4:8d#3,8d#4,8a#4,8b4,d#,8b4,d,8a#4,8c#,8a4,8c#,c.,8d#3,8d#4,8a#4,8b4,d#,8b4,d,8a#4,8c#,8a"
]
},
{
"name": "Snap! - Rythm Is A Dancer",
"tracks": [
"motor1:b=280,o=5,d=16:p,4e,p,4c,p,4d,p,4c,p,4f4,p,4f4,p,4a4,p,4f4,p,4g4,p,4g4,p,4b4,p,4g4,p,4a4,p,4a4,p,4c,p,4a4",
"motor2:b=280,o=4,d=32:8a,p,8a,p,8a,p,8a,p,8a,p,8a,p,8a,p,8a,p,8f,p,8f,p,8f,p,8f,p,8f,p,8f,p,8f,p,8f,p,8g,p,8g,p,8g,p,8g,p,8g,p,8g,p,8g,p,8g,p,8a,p,8a,p,8a,p,8a,p,8a,p,8a,p,8a,8p",
"motor3:b=280,o=4,d=32:8a,p,8a,p,8a,p,8a,p,8a,p,8a,p,8a,p,8a,p,8f,p,8f,p,8f,p,8f,p,8f,p,8f,p,8f,p,8f,p,8g,p,8g,p,8g,p,8g,p,8g,p,8g,p,8g,p,8g,p,8a,p,8a,p,8a,p,8a,p,8a,p,8a,p,8a,8p",
"motor4:b=280,o=5,d=16:4e,p,4c,p,4d,p,4c,p,4f4,p,4f4,p,4a4,p,4f4,p,4g4,p,4g4,p,4b4,p,4g4,p,4a4,p,4a4,p,4c,p,4a4,p"
]
},
{
"name": "Spider Dance - Undertale OST",
"tracks": [
Expand Down Expand Up @@ -384,6 +417,15 @@
"WE_WISH_YOU:d=2,o=2,b=384:2c#4,16p,2a#4,16p,2a#4,16p,2a#4,16p,2b#5,16p,2b#5,16p,2d#4,16p,2c5,16p,2c5,16p,2c5,16p,2c#5,16p,2c#5,16p,2c#4,16p,2d4,16p,2d4,16p,2f#4,16p,2d#4,16p,2c#4,16p,2c#4,16p,2f#4,16p,2b#4,16p,2c#4,16p,1c#4"
]
},
{
"name":"Windows XP Startup Sound",
"tracks":[
"WinXPStartup1:b=100,o=7,d=8:4f3.,4g#3.,4d#3",
"WinXPStartup2:b=100,o=7,d=8:4c4.,4d#4.,4a#3",
"WinXPStartup3:b=100,o=7,d=8:4g#4.,4g#4.,4d#4",
"WinXPStartup4:b=100,o=7,d=8:d#5,16d#4,a#4.,g#4,d#4,d#5,4a#4"
]
},
{
"name": "X-Files",
"tracks": [
Expand Down
2 changes: 1 addition & 1 deletion src/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "v0.28.1",
"version": "v0.29.0",
"corsProxy": "https://cors.bubblesort.me/?",
"availableLanguages": [
{
Expand Down
4 changes: 4 additions & 0 deletions src/sources/AM32/escs.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@
"Wraith_32": {
"name": "Wraith 32",
"fileName": "WRAITH32"
},
"KM55A_BUTTER": {
"name": "SkyStars Butter",
"fileName": "GD32E_SKYSTARS_KM55"
}
}
}
4 changes: 2 additions & 2 deletions src/sources/Bluejay/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ describe('Bluejay', () => {
visibleIf.push(current.visibleIf);
}
}

expect(visibleIf.length).toEqual(0);
}

expect(visibleIf.length).toEqual(2);
});

it('should handle conditional visibility with custom settings', () => {
Expand Down
12 changes: 12 additions & 0 deletions src/sources/Bluejay/eeprom.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,18 @@ const LAYOUT = {
offset: 0x28,
size: 1,
},
POWER_RATING: {
offset: 0x29,
size: 1,
},
PWM_THRESHOLD_LOW: {
offset: 0x2A,
size: 1,
},
PWM_THRESHOLD_HIGH: {
offset: 0x2B,
size: 1,
},

LAYOUT: {
offset: 0x40,
Expand Down
4 changes: 4 additions & 0 deletions src/sources/Bluejay/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ class BluejaySource extends GithubSource {
let pwm = '';
if(settings.PWM_FREQUENCY && settings.PWM_FREQUENCY !== 0xFF) {
pwm = `, ${settings.PWM_FREQUENCY}kHz`;

if(settings.PWM_FREQUENCY === 192) {
pwm = ', Dynamic PWM';
}
}
const name = `${settings.NAME.trim()}`;

Expand Down
83 changes: 82 additions & 1 deletion src/sources/Bluejay/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,73 @@ COMMON['205'] = {
],
};

COMMON['206'] = {
base: [
...COMMON['204'].base,
{
name: 'POWER_RATING',
type: 'enum',
label: 'escPowerRating',
options: [{
value: '1',
label: '1S',
}, {
value: '2',
label: '2S+',
}],
},
],
};

COMMON['207'] = {
base: [
...COMMON['206'].base,
{
name: 'PWM_FREQUENCY',
type: 'enum',
label: 'escPwmFrequencyBluejay',
options: [{
value: 24,
label: '24kHz',
}, {
value: 48,
label: '48kHz',
}, {
value: 96,
label: '96kHz',
}, {
value: 192,
label: 'Dynamic',
}],
}, {
name: 'PWM_THRESHOLD_LOW',
type: 'number',
min: 0,
max: 100,
step: 1,
displayFactor: 100 / 255,
label: 'escPwmThresholdLow',
visibleIf: (settings) => ('PWM_FREQUENCY' in settings) && (parseInt(settings.PWM_FREQUENCY, 10) === 192),
sanitize: (value, settings) => {
if(value > settings.PWM_THRESHOLD_HIGH) {
return settings.PWM_THRESHOLD_HIGH;
}

return value;
},
}, {
name: 'PWM_THRESHOLD_HIGH',
type: 'number',
min: 0,
max: 100,
step: 1,
displayFactor: 100 / 255,
label: 'escPwmThresholdHigh',
visibleIf: (settings) => ('PWM_FREQUENCY' in settings) && (parseInt(settings.PWM_FREQUENCY, 10) === 192),
},
],
};

const INDIVIDUAL_SETTINGS_200 = [{
name: 'MOTOR_DIRECTION',
type: 'enum',
Expand Down Expand Up @@ -395,6 +462,8 @@ const INDIVIDUAL_SETTINGS_203 = [
];

const INDIVIDUAL = {
'207': { base: INDIVIDUAL_SETTINGS_203 },
'206': { base: INDIVIDUAL_SETTINGS_203 },
'205': { base: INDIVIDUAL_SETTINGS_203 },
'204': { base: INDIVIDUAL_SETTINGS_203 },
'203': { base: INDIVIDUAL_SETTINGS_203 },
Expand Down Expand Up @@ -445,13 +514,25 @@ DEFAULTS['204'] = { // v0.15
BRAKING_STRENGTH: 255,
};

DEFAULTS['205'] = {
DEFAULTS['205'] = { // unreleased
...DEFAULTS['204'],
STARTUP_BEEP: 1,
STARTUP_MELODY_WAIT_MS: 0,
PWM_FREQUENCY: 24,
};

DEFAULTS['206'] = { // v0.19
...DEFAULTS['204'],
POWER_RATING: 2,
};

DEFAULTS['207'] = { // v0.20
...DEFAULTS['206'],
PWM_FREQUENCY: 24,
PWM_THRESHOLD_LOW: 100,
PWM_THRESHOLD_HIGH: 150,
};

const settings = {
DEFAULTS,
INDIVIDUAL,
Expand Down
5 changes: 5 additions & 0 deletions src/translations/cs/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@
"escButtonWrite": "Zápis nastavení",
"buttonCancel": "Zrušit",
"escButtonSelect": "Nahrát",
"escPowerRading": "Jmenovitý výkon",
"defaultChangelogTitle": "Seznam Změn",
"changelogClose": "Zavřít",
"escDampingMode": "Tlumící režim (doplňkový PWM)",
"escBrakingStrength": "Maximální brzdná síla",
"escPowerRating": "ESC Power Rating",
"homeExperimental": "Toto je experimentální webová aplikace pro online konfiguraci firmwaru ESC.",
"homeVersionInfo": "Zde vždy najdete nejnovější stabilní verzi. V současné době je podporován následující firmware:",
"homeContributionHeader": "Přispívání",
Expand Down Expand Up @@ -87,6 +89,9 @@
"escStallProtection": "Ochrana proti zablokování",
"escTimingAdvance": "Předstih [degrees]",
"escPwmFrequency": "Frekvence PWM [kHz]",
"escPwmFrequencyBluejay": "PWM Frequency",
"escPwmThresholdLow": "PWM low threshold",
"escPwmThresholdHigh": "PWM high threshold",
"escMotorKv": "Motor [Kv]",
"escMotorPoles": "Póly motoru",
"escBeepVolume": "Hlasitost pípání",
Expand Down
5 changes: 4 additions & 1 deletion src/translations/cs/hints.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"USE_HALL_SENSORS": "Pro regulátory otáček pro použití se senzorovými motory se vstupem Hallova čidla.",
"SINE_MODE_RANGE": "Množství plynu v procentech použité pro sinusoidální startování.",
"BRAKE_STRENGTH": "Úroveň přidržovací brzdy, která se použije při zapnutí brzdění.",
"BRAKING_STRENGTH": "Maximální brzdná síla (doplňkový brzdný cyklus PWM)."
"BRAKING_STRENGTH": "Maximální brzdná síla (doplňkový brzdný cyklus PWM).",
"POWER_RATING": "Pokud používáte EDT při nastaveních 1S, budou hodnoty teploty vypnuty, pokud nebudou nastaveny na 1S. Všechna nastavení s 2S a více není třeba měnit toto nastavení.",
"PWM_THRESHOLD_LOW": "Below this throttle, a 96kHz PWM signal will be used. Between low and high, a 48kHz PWM signal will beused.",
"PWM_THRESHOLD_HIGH": "Above this throttle, a 24kHz PWM signal will be used."
}
Loading

0 comments on commit 62b0268

Please sign in to comment.