Skip to content

Commit

Permalink
Merge branch 'release/0.28.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
stylesuxx committed Jan 15, 2023
2 parents 845a51c + afefaaf commit 50ca893
Show file tree
Hide file tree
Showing 45 changed files with 319 additions and 93 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "esc-configurator",
"version": "0.27.2",
"version": "0.29.0",
"private": false,
"license": "AGPL-3.0",
"dependencies": {
"@babel/plugin-transform-react-jsx": "^7.16.7",
"@palmabit/react-cookie-law": "^0.6.2",
"autoprefixer": "^10.4.2",
"bin-to-hex": "^0.4.1",
"bluejay-rtttl-parse": "^2.0.2",
"compare-versions": "^4.1.3",
"dateformat": "^5.0.2",
Expand Down
1 change: 1 addition & 0 deletions src/Components/FirmwareSelector/__tests__/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ describe('FirmwareSelector', () => {
onCancel={onCancel}
onLocalSubmit={onLocalSubmit}
onSubmit={onSubmit}
showUnstable={false}
/>
);

Expand Down
49 changes: 32 additions & 17 deletions src/Components/MainContent/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,41 @@ function WarningWrapper() {
const { t } = useTranslation('common');

return (
<div className="note">
<p>
<>
<div className="note warning">
<span>
<strong>
{t('note')}
<strong sx={{ color: "red" }}>
{t('warning')}
</strong>

{t('warningRadio')}
</span>
</div>

<ReactMarkdown components={{ p: 'span' }}>
{t('notePropsOff')}
</ReactMarkdown>
<div className="note">
<p>
<span>
<strong>
{t('note')}
</strong>
</span>

<br />
<ReactMarkdown components={{ p: 'span' }}>
{t('notePropsOff')}
</ReactMarkdown>

<span>
<strong>
{t('note')}
</strong>
<br />

{t('noteConnectPower')}
</span>
</p>
</div>
<span>
<strong>
{t('note')}
</strong>

{t('noteConnectPower')}
</span>
</p>
</div>
</>
);
}

Expand Down Expand Up @@ -85,8 +97,11 @@ function MainContent({
const unsupportedNames = ['JESC', 'BLHeli_M', 'BLHeli_32'];
const unsupported = unsupportedNames.includes(settings.NAME);

const disableFlashingNames = ['BLHeli_32'];
const disableFlashing = disableFlashingNames.includes(settings.NAME);

const canWrite = (escs.length > 0) && !isSelecting && settings && !isFlashing && !isReading && !isWriting && !unsupported;
const canFlash = (escs.length > 0) && !isSelecting && !isWriting && !isFlashing && !isReading;
const canFlash = (escs.length > 0) && !isSelecting && !isWriting && !isFlashing && !isReading && !disableFlashing;
const canRead = !isReading && !isWriting && !isSelecting && !isFlashing;
const showMelodyEditor = escs.length > 0 && escs[0].individualSettings.STARTUP_MELODY ? true : false;

Expand Down
13 changes: 11 additions & 2 deletions src/Components/MainContent/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@

.note {
margin-bottom: 20px;
background-color: #fff7cd;
border: 1px solid #ffe55f;
background-color: #fff3cd;
border: 1px solid #ffeeba;
color: #856404;

margin-top: 5px;
margin-bottom: 25px;
border-radius: 3px;
Expand All @@ -24,6 +26,13 @@
@media screen and (max-width: 768px) {
margin-bottom: 18px;
}

&.warning {
margin-bottom: 10px;
color: #721c24;
background-color: #f8d7da;
border-color: #f5c6cb;
}
}

.note.alert {
Expand Down
4 changes: 0 additions & 4 deletions src/Components/MelodyEditor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
display: flex;
flex-direction: row;

.info-wrapper-wrapper {
white-space: nowrap;
}

select {
margin-left: 10px;
height: 20px;
Expand Down
15 changes: 11 additions & 4 deletions src/Containers/App/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { Component } from 'react';
import Rtttl from 'bluejay-rtttl-parse';
import dateFormat from 'dateformat';
import i18next from 'i18next';
import BinToHex from 'bin-to-hex';

import { fetchHexCached } from '../../utils/Fetch';
import { getMasterSettings } from '../../utils/helpers/Settings';
Expand Down Expand Up @@ -210,10 +211,14 @@ class App extends Component {
};

fetchConfigs = async() => {
const { configs } = this.state;
const {
appSettings,
configs,
} = this.state;
for(let i = 0; i < sources.length; i += 1) {
const source = sources[i];
const name = source.getName();
source.setSkipCache(appSettings.settings.skipCache.value);

try {
configs.versions[name] = await source.getVersions();
Expand Down Expand Up @@ -572,16 +577,18 @@ class App extends Component {
this.setActions({ isFlashing: true });

this.addLogMessage('dumpingEsc', { index: target + 1 });
const data = await this.serial.readFirmware(target, esc, updateProgress);
const dataBin = await this.serial.readFirmware(target, esc, updateProgress);
const binToHex = new BinToHex(16, 0x00, 0xFF);
const dataHex = binToHex.convert(dataBin);
updateProgress(0);

this.setActions({ isFlashing: false });


const element = document.createElement("a");
const file = new Blob([data], { type: 'application/octet/stream' });
const file = new Blob([dataHex], { type: 'text/plain' });
element.href = URL.createObjectURL(file);
element.download = "firmware.bin";
element.download = "dump.hex";
document.body.appendChild(element);
element.click();
};
Expand Down
15 changes: 14 additions & 1 deletion src/changelog.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
[
{
"title": "Unreleased",
"items": [
"Enhancement: More melodies",
"Enhancement: Show warning to turn off radio",
"Enhancement: Dump firmware as HEX file instead of BIN",
"Enhancement: Allow skipping cache for new releases",
"Bugifx: Do not check for mistagging if JESC is detected",
"Bugfix: Properly display flashed fail in ESC name",
"Bugfix: Allow re-flashing if firmware is broken",
"Bugfix: Do not cut off hint text for melody sync checkbox"
]
},
{
"title": "0.27.2",
"items": [
"Bugfix: Limit fetching release list for Bluejay to the last 5 releases"
"Chore: Limit to fetching last 5 releases"
]
},
{
Expand Down
88 changes: 87 additions & 1 deletion src/melodies.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@
"oops4:d=4,o=5,b=120:p.,a3,2d4,2c#4"
]
},
{
"name": "Bobby Helms - Jingle Bell Rock",
"tracks": [
"jingle1:b=200,o=5,d=4:f#,32p,8f#,32p,8f#,p,f#,32p,8f#,32p,8f#,p,f#,32p,8a,32p,d,32p,8e,64p,f,32p,8e,32p,d,32p,8b4,32p,2a4",
"jingle2: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",
"jingle3:b=200,o=5,d=4:f#,32p,8f#,32p,8f#,p,f#,32p,8f#,32p,8f#,p,f#,32p,8a,32p,d,32p,8e,64p,f,32p,8e,32p,d,32p,8b4,32p,2a4",
"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": "Chiquitita - Abba",
"tracks": [
Expand All @@ -77,6 +86,24 @@
"ab_chiq_b2:b=104,o=4,d=16:a3,p,a3,p,a,p,a3,p,a3,p,a3,p,a,p,a3,p,a3,p,a3,p,a,p,a3,p,a,p,a,p,h,p,c#5,p,d,p,d,p,d5,p,d,p,d,p,d,p,d5,p,d,p,d,p,d,p,d5,p,d,p,d,p,d,p,8d5"
]
},
{
"name": "Cheech and Chong - Earache my eye",
"tracks": [
"Earache:d=4,o=3,b=180:8b,8a#,a,8b,8a#,a,d4,32p,d4,1b,1b",
"Earache:d=4,o=4,b=180:8b,8a#,a,8b,8a#,a,d5,32p,d5,1b,1b",
"Earache:d=4,o=3,b=180:8b,8a#,a,8b,8a#,a,d4,32p,d4,1b,1b",
"Earache:d=4,o=4,b=180:8f#,8f,e,8f#,8f,e,a,32p,a,1f#,1f#"
]
},
{
"name": "Doom Theme",
"tracks": [
"e1m1:b=420,o=4,d=32:8c4,8p,4c4,4c5,8c4,8p,4c4,4a#4,8c4,8p,4c4,4g#4,8c4,8p,4c4,4f#4,8c4,8p,4c4,4g4,4g#4,8c4,8p,4c4,4c5,8c4,8p,4c4,4a#4,8c4,8p,4c4,4g#4,8c4,8p,4c4,1f#4",
"e1m1:b=420,o=4,d=32:8c4,8p,4c4,4c5,8c4,8p,4c4,4a#4,8c4,8p,4c4,4g#4,8c4,8p,4c4,4f#4,8c4,8p,4c4,4g4,4g#4,8c4,8p,4c4,4c5,8c4,8p,4c4,4a#4,8c4,8p,4c4,4g#4,8c4,8p,4c4,1c4",
"e1m1:b=420,o=4,d=32:4c4,4p,4c4,4p,4c4,4p,4c4,4p,4c4,4p,4c4,4p,4c4,2c4,4p,4c4,2p,4p,4c4,2p,4p,4c4,4p,4c4,1c4",
"e1m1:b=420,o=4,d=32:8c5,8p,4c5,4c6,8c5,8p,4c5,4a#5,8c5,8p,4c5,4g#5,8c5,8p,4c5,4f#5,8c5,8p,4c5,4g5,4g#5,8c5,8p,4c5,4c6,8c5,8p,4c5,4a#5,8c5,8p,4c5,4g#5,8c5,8p,4c5,1f#4"
]
},
{
"name": "Everything is Awesome",
"tracks": [
Expand All @@ -95,6 +122,12 @@
"expance4:b=140,o=3,d=4:p,p,2f,8f.,16p,f,2e,2p,1a,p"
]
},
{
"name": "Guns n Roses - Sweet Child O Mine",
"tracks": [
"SweetChi:d=4,o=5,b=125:8f6,8g#,8d#,8c#6,8g#,8f#,8f#6,8g#,8f6,8g#,8d#,8c#6,8g#,8f#,8f#6,8g#,8f6,8g#"
]
},
{
"name": "Giorno's Theme",
"tracks": [
Expand All @@ -120,6 +153,15 @@
"mmmbop4:d=4,o=5,b=104:p.,8e.3,16p,8e.3,16p,8e3,16p,16e3,8p,8e3,8f#.3,16p,8f#.3,16p,8f#3,16p,16f#3,8p,8f#3,8e.3,16p,8e.3,16p,8e3,16p,16e3,8p,8e3"
]
},
{
"name": "Kino - A Pack of Cigarettes",
"tracks": [
"Kino1:b=128,o=7,d=8:b4,c5,b5,a5,e5,4c5,g5,e5,c5,4d5,a5,f#5,c5,b4,b4,b5,a5,e5,4c5,g5,e5,b4,c5,p,a5,f#5,c5,4b4",
"Kino2:b=128,o=7,d=8:e4,e3,4a3,p,a3,4c4,p,c4,4d4,p,d4,4e4,4e4,4a3,p,a3,4c4,p,c4,4d4,p,d4,4e4",
"Kino3:b=128,o=7,d=8:b4,c5,b5,a5,e5,4c5,g5,e5,c5,4d5,a5,f#5,c5,b4,b4,b5,a5,e5,4c5,g5,e5,b4,c5,p,a5,f#5,c5,4b4",
"Kino4:b=128,o=7,d=8:e4,e3,4a3,p,a3,4c4,p,c4,4d4,p,d4,4e4,4e4,4a3,p,a3,4c4,p,c4,4d4,p,d4,4e4"
]
},
{
"name": "Loituma - Ievan Polkka",
"tracks": [
Expand Down Expand Up @@ -192,6 +234,15 @@
"pokemon4:b=135,o=5,d=4:16d4,8p.,1p,16g3,8p.,16g3,8p.,32g3,32p,32g3,32p,16g3,16p,32g3,32p,32g3,32p,16g3,16p,16g3,p,16p,16g3,16p,p,16g3,8p.,16f3,16p,p,16f3,p,16p,16f3,8p.,16g3,p,16p,16g3,p,16p,16g3,8p.,16g3"
]
},
{
"name": "Pokémon Red/Blue Title Theme (Short)",
"tracks": [
"PkmnOpening1:d=8,o=7,b=198:16d4,16p,16d4,16p,4a4,16d4,16p,16d4,16p,4a#4,16d4,16p,16d4,16p,4c5,16d4,16p,16d4,16p,4c#5,1d5",
"PkmnOpening2:d=8,o=7,b=198:16a3,16p,16a3,16p,4d4,16a3,16p,16a3,16p,4d#4,16a3,16p,16a3,16p,4f4,16a3,16p,16a3,16p,4g4,1f#4",
"PkmnOpening3:d=8,o=7,b=198:16d4,16p,16d4,16p,4a4,16d4,16p,16d4,16p,4a4,16d4,16p,16d4,16p,4a#4,16d4,16p,16d4,16p,4a#4,1a4",
"PkmnOpening4:d=8,o=7,b=198:16d4,16p,16d4,16p,4a4,16d4,16p,16d4,16p,4a#4,16d4,16p,16d4,16p,4c5,16d4,16p,16d4,16p,4c#5,1d5"
]
},
{
"name": "Rick & Morty Theme",
"tracks": [
Expand Down Expand Up @@ -244,11 +295,17 @@
]
},
{
"name": "Starwars Theme",
"name": "Star Wars Theme",
"tracks": [
"starwars:d=4,o=5,b=180:8f,8f,8f,2a#.,2f.6,8d#6,8d6,8c6,2a#.6,f.6,8d#6,8d6,8c6,2a#.6,f.6,8d#6,8d6,8d#6,2c6"
]
},
{
"name": "Star Wars - Cantina Song",
"tracks": [
"Cantina:d=4,o=5,b=250:8a,8p,8d6,8p,8a,8p,8d6,8p,8a,8d6,8p,8a,8p,8g#,a,8a,8g#,8a,g,8f#,8g,8f#,f.,8d.,16p,p.,8a,8p,8d6,8p,8a,8p,8d6,8p,8a,8d6,8p,8a,8p,8g#,8a,8p,8g,8p,g.,8f#,8g,8p,8c6,a#,a,g"
]
},
{
"name": "Star Trek - The Next Generation",
"tracks": [
Expand Down Expand Up @@ -307,6 +364,26 @@
"le_unama_b:b=150,o=4,d=1:2p,8p,8f3,8c,8a,8c,8a,8c,8a,8c,8g3,8d,8h,8d,8h,8d,8h,8d,8a3,8e,8c5,8e,8c5,8e,8c5,8e,4c5,2p.,8f3,8c,8a,8c,8a,8c,8a,8c,8g3,8d,8h,8d,8h,8d,8h,8d,8a3,8e,8a,8e,8a,8e,8a,8e,4a"
]
},
{
"name": "Violent Femmes - Blister In the Sun",
"tracks": [
"BlisterI:d=4,o=5,b=285:e.,8g#.,8e.,a.,8g#.,e.,g#.,8e.,a.,g#.,e.,8g#.,8e.,a.,8g#.,e.,p,p,p,p,p,e.,8g#.,8e.,a.,8g#.,e.,g#.,8e.,a.,g#.,e.,8g#.,8e.,a.,8g#.,e."
]
},
{
"name": "Violent Femmes - Blister In the Sun (short)",
"tracks": [
"BlisterI:d=4,o=5,b=285:e.,8g#.,8e.,a.,8g#.,e.,g#.,8e.,a.,g#.,e.,8g#.,8e.,a.,8g#.,e."
]
},
{
"name":"We wish you a merry christmas",
"tracks":[
"WE_WISH_YOU:d=2,o=2,b=384:2c#4,16p,2f#4,16p,4f#4,32p,4g#4,32p,4f#4,32p,4f4,32p,2d#4,32p,2d#4,16p,2d#4,16p,2g#4,16p,4g#4,32p,4a#4,32p,4g#4,32p,4f#4,32p,2f4,16p,2c#4,16p,2c#4,16p,2a#4,16p,4a#4,32p,4b4,32p,4a#4,32p,4g#4,32p,2f#4,16p,2d#4,16p,4c#4,32p,4c#4,16p,2d#4,16p,2g#4,16p,2f4,16p,1f#4",
"WE_WISH_YOU:d=2,o=2,b=384:2c#4,16p,2f#4,16p,2f#4,16p,2f#4,16p,2d#4,16p,2d#4,16p,2d#4,16p,2g#4,16p,2g#4,16p,2g#4,16p,2f4,16p,2c#4,16p,2c#4,16p,2a#4,16p,2a#4,16p,2a#4,16p,2f#4,16p,2f#4,16p,2c#4,16p,2d#4,16p,2g#4,16p,2f4,16p,1a#4",
"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": "X-Files",
"tracks": [
Expand All @@ -322,6 +399,15 @@
"GON_GIVE_IT_TO_YA:d=2,o=2,b=384:2a#4,16p,2a#4,16p,4a#6,32p,4a#6,32p,4a#6,32p,4a#6,32p,2g#4,16p,2g#4,16p,4g#6,32p,4g#6,32p,4g#6,32p,4g#6,32p,2f#4,16p,2f#4,16p,4f#6,32p,4f#6,32p,4f#6,32p,4f#6,32p,2d#4,16p,2d#4,16p,4d#6,32p,4d#6,32p,4d#6,32p,4d#6,32p"
]
},
{
"name": "Zelda Chest opening",
"tracks": [
"ZeldaChest1:b=122,o=7,d=8:16b4,16c#5,16d#5,16f5,16c5,16d5,16e5,16f#5,16c#5,16d#5,16f5,16g5,16d5,16e5,16f#5,16g#5,4p,a5,e5,f5,2f#5",
"ZeldaChest2:b=122,o=7,d=8:4c#4,4d4,4d#4,4e4,4p,c5,c#5,d5,2d#5",
"ZeldaChest3:b=122,o=7,d=8:16b3,16c#4,16d#4,16f4,16c4,16d4,16e4,16f#4,16c#4,16d#4,16f4,16g4,16d4,16e4,16f#4,16g#4,4p,d#5,a#5,g4,2g#4",
"ZeldaChest4:b=122,o=7,d=8:16b4,16c#5,16d#5,16f5,16c5,16d5,16e5,16f#5,16c#5,16d#5,16f5,16g5,16d5,16e5,16f#5,16g#5,4p,f4,f#4,b5,2c6"
]
},
{
"name": "Zelda Theme",
"tracks": [
Expand Down
6 changes: 5 additions & 1 deletion src/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "v0.27.2",
"version": "v0.29.0",
"corsProxy": "https://cors.bubblesort.me/?",
"availableLanguages": [
{
Expand Down Expand Up @@ -60,6 +60,10 @@
"unstableVersions": {
"type": "boolean",
"value": false
},
"skipCache": {
"type": "boolean",
"value": false
}
}
}
4 changes: 4 additions & 0 deletions src/sources/AM32/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class AM32Source extends GithubSource {
async getVersions() {
return this.getRemoteVersionsList(GITHUB_REPO, blacklist);
}

getValidNames() {
return Object.keys(escs.layouts);
}
}

const source = new AM32Source(
Expand Down
7 changes: 6 additions & 1 deletion src/sources/Blheli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import Source from '../Source';

class BLHeliSource extends Source {
buildDisplayName(flash, make) {
const flashFailedString = "**FLASH*FAILED**";
const {
MAIN_REVISION, SUB_REVISION,
MAIN_REVISION, SUB_REVISION, NAME,
} = flash.settings;
let revision = 'Unsupported/Unrecognized';
if(MAIN_REVISION !== undefined && SUB_REVISION !== undefined) {
Expand All @@ -14,6 +15,10 @@ class BLHeliSource extends Source {
make += ` (Probably mistagged: ${flash.actualMake})`;
}

if(NAME === flashFailedString) {
return flashFailedString;
}

return `${make} - ${this.name}, ${revision}`;
}

Expand Down
Loading

0 comments on commit 50ca893

Please sign in to comment.