1
0
forked from me/IronOS

Merge branch 'master' into extend-font-encoding

This commit is contained in:
Ben V. Brown
2021-03-17 21:17:17 +11:00
committed by GitHub
10 changed files with 149 additions and 64 deletions

11
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
version: 2
# Fetch and update latest `github-actions` pkgs
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
time: '00:00'
open-pull-requests-limit: 10
commit-message:
prefix: chore
include: scope

58
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,58 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '38 23 * * 6'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
- run: |
chmod +x setup.sh && chmod +x source/build.sh && sudo mkdir -p /build/cache && sudo chmod -R 777 /build
./setup.sh
cd source && ./build.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

18
SECURITY.md Normal file
View File

@@ -0,0 +1,18 @@
# Security Policy
## Supported Versions
Use this section to tell people about which versions of your project are
currently being supported with security updates.
| Version | Supported |
| ------- | ------------------ |
| Latest Release | :white_check_mark: |
| master | :white_check_mark: |
## Reporting a Vulnerability
1. Report in an issue please and tag @ralim
2. All issues are read within 1 working week in general; often within 24 hours
3. Issue shall recieve a comment within 14 days; but goal is < 2.
4. Issue will be open until the vulnerability is closed in all supported versions

View File

@@ -274,12 +274,12 @@ def getFontMapAndTable(textList):
for sym in forcedFirstSymbols: for sym in forcedFirstSymbols:
if sym not in fontTable: if sym not in fontTable:
log("Missing Large font element for {}".format(sym)) log("Missing Large font element for {}".format(sym))
exit(1) sys.exit(1)
fontLine = fontTable[sym] fontLine = fontTable[sym]
fontTableStrings.append(fontLine + "//{} -> {}".format(symbolMap[sym], sym)) fontTableStrings.append(fontLine + "//{} -> {}".format(symbolMap[sym], sym))
if sym not in fontSmallTable: if sym not in fontSmallTable:
log("Missing Small font element for {}".format(sym)) log("Missing Small font element for {}".format(sym))
exit(1) sys.exit(1)
fontLine = fontSmallTable[sym] fontLine = fontSmallTable[sym]
fontSmallTableStrings.append( fontSmallTableStrings.append(
fontLine + "//{} -> {}".format(symbolMap[sym], sym) fontLine + "//{} -> {}".format(symbolMap[sym], sym)
@@ -291,7 +291,7 @@ def getFontMapAndTable(textList):
fromFont = getCJKGlyph(sym) fromFont = getCJKGlyph(sym)
if fromFont is None: if fromFont is None:
log("Missing Large font element for {}".format(sym)) log("Missing Large font element for {}".format(sym))
exit(1) sys.exit(1)
# We store the glyph back to the fontTable. # We store the glyph back to the fontTable.
fontTable[sym] = fromFont fontTable[sym] = fromFont
# We also put a "replacement character" in the small font table # We also put a "replacement character" in the small font table
@@ -302,7 +302,7 @@ def getFontMapAndTable(textList):
fontTableStrings.append(fontLine + "//{} -> {}".format(symbolMap[sym], sym)) fontTableStrings.append(fontLine + "//{} -> {}".format(symbolMap[sym], sym))
if sym not in fontSmallTable: if sym not in fontSmallTable:
log("Missing Small font element for {}".format(sym)) log("Missing Small font element for {}".format(sym))
exit(1) sys.exit(1)
fontLine = fontSmallTable[sym] fontLine = fontSmallTable[sym]
fontSmallTableStrings.append( fontSmallTableStrings.append(
fontLine + "//{} -> {}".format(symbolMap[sym], sym) fontLine + "//{} -> {}".format(symbolMap[sym], sym)

View File

@@ -38,7 +38,7 @@
"SettingFastChar": "S", "SettingFastChar": "S",
"SettingSlowChar": "L", "SettingSlowChar": "L",
"SettingMediumChar": "M", "SettingMediumChar": "M",
"SettingOffChar":"A", "SettingOffChar": "A",
"SettingStartSolderingChar": "L", "SettingStartSolderingChar": "L",
"SettingStartSleepChar": "R", "SettingStartSleepChar": "R",
"SettingStartSleepOffChar": "K", "SettingStartSleepOffChar": "K",
@@ -55,10 +55,10 @@
"menuGroups": { "menuGroups": {
"PowerMenu": { "PowerMenu": {
"text2": [ "text2": [
"Power", "Energie-",
"settings" "einstellungen"
], ],
"desc": "Power settings" "desc": "Energieeinstellungen"
}, },
"SolderingMenu": { "SolderingMenu": {
"text2": [ "text2": [
@@ -289,37 +289,37 @@
"MinVolCell": { "MinVolCell": {
"text2": [ "text2": [
"Minimum", "Minimum",
"voltage" "Spannung"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S 3.0V - 3.7V, 4/5/6S 2.4V - 3.7V>" "desc": "Minimal zulässige Spannung pro Zelle <Volt> <3S - 3,0V - 3,7V, 4/5/6S - 2,4V - 3,7V>"
}, },
"AnimLoop": { "AnimLoop": {
"text2": [ "text2": [
"Anim.", "Anim.",
"loop" "Schleife"
], ],
"desc": "Loop icon animations in root menu" "desc": "Icon-Animationen im Stammmenü wiederholen"
}, },
"AnimSpeed": { "AnimSpeed": {
"text2": [ "text2": [
"Anim.", "Anim.",
"speed" "Geschw."
], ],
"desc": "Speed of icon animations in menu <O=off | L=low | M=medium | H=high>" "desc": "Geschwindigkeit der Icon-Animationen im Menü <A=aus | N=niedrig | M=mittel | H=hoch>"
}, },
"PowerPulseWait": { "PowerPulseWait": {
"text2": [ "text2": [
"Power pulse", "Leistungsimpulse",
"wait time" "Wartezeit"
], ],
"desc": "Time to wait before triggering every keep-awake pulse (x 2.5s)" "desc": "Wartezeit vor dem Auslösen jedes Wachhalteimpulses (x 2,5s)"
}, },
"PowerPulseDuration": { "PowerPulseDuration": {
"text2": [ "text2": [
"Power pulse", "Leistungsimpulse",
"duration" "Dauer"
], ],
"desc": "Keep-awake-pulse duration (x 250ms)" "desc": "Dauer des Wachhalteimpulses (x 250ms)"
} }
} }
} }

View File

@@ -49,15 +49,15 @@
"SettingLockDisableChar": "D", "SettingLockDisableChar": "D",
"SettingLockBoostChar": "T", "SettingLockBoostChar": "T",
"SettingLockFullChar": "C", "SettingLockFullChar": "C",
"SettingNAChar": "N/A" "SettingNAChar": "NA"
}, },
"menuGroups": { "menuGroups": {
"PowerMenu": { "PowerMenu": {
"text2": [ "text2": [
"Power", "Opzioni",
"settings" "alimentaz"
], ],
"desc": "Power settings" "desc": "Menù d'impostazioni per l'alimentazione"
}, },
"SolderingMenu": { "SolderingMenu": {
"text2": [ "text2": [
@@ -94,42 +94,42 @@
"Sorgente", "Sorgente",
"alimentaz" "alimentaz"
], ],
"desc": "Scegli la sorgente di alimentazione; se a batteria, limita lo scaricamento al valore di soglia <DC: 10V; S: 3,3V per cella>" "desc": "Imposta una tensione minima di alimentazione attraverso la selezione di una sorgente [DC: 10 V; 3S/4S/5S/6S: 3,3 V per cella]"
}, },
"SleepTemperature": { "SleepTemperature": {
"text2": [ "text2": [
"Temp", "Temp",
"riposo" "riposo"
], ],
"desc": "Imposta la temperatura da mantenere in modalità Riposo <°C/°F>" "desc": "Imposta la temperatura da mantenere in modalità Riposo [°C/°F]"
}, },
"SleepTimeout": { "SleepTimeout": {
"text2": [ "text2": [
"Timer", "Timer",
"riposo" "riposo"
], ],
"desc": "Imposta il timer per entrare in modalità Riposo <minuti/secondi>" "desc": "Imposta il timer per entrare in modalità Riposo [minuti/secondi]"
}, },
"ShutdownTimeout": { "ShutdownTimeout": {
"text2": [ "text2": [
"Timer", "Timer",
"spegnimento" "spegnimento"
], ],
"desc": "Imposta il timer per lo spegnimento <minuti>" "desc": "Imposta il timer per lo spegnimento [minuti]"
}, },
"MotionSensitivity": { "MotionSensitivity": {
"text2": [ "text2": [
"Sensibilità", "Sensibilità",
"al movimento" "al movimento"
], ],
"desc": "Imposta la sensibilità al movimento per uscire dalla modalità Riposo <0: nessuna; 1: minima; 9: massima>" "desc": "Imposta la sensibilità al movimento per uscire dalla modalità Riposo [0: nessuna; 1: minima; 9: massima]"
}, },
"TemperatureUnit": { "TemperatureUnit": {
"text2": [ "text2": [
"Unità di", "Unità di",
"temperatura" "temperatura"
], ],
"desc": "Scegli l'unità di misura per la temperatura <C: grado Celsius; F: grado Farenheit>" "desc": "Scegli l'unità di misura per la temperatura [C: grado Celsius; F: grado Farenheit]"
}, },
"AdvancedIdle": { "AdvancedIdle": {
"text2": [ "text2": [
@@ -143,21 +143,21 @@
"Orientamento", "Orientamento",
"display" "display"
], ],
"desc": "Imposta l'orientamento del display <A: automatico; S: mano sinistra; D: mano destra>" "desc": "Imposta l'orientamento del display [A: automatico; S: mano sinistra; D: mano destra]"
}, },
"BoostTemperature": { "BoostTemperature": {
"text2": [ "text2": [
"Temp", "Temp",
"«Turbo»" "Turbo"
], ],
"desc": "Imposta la temperatura della funzione «Turbo» <°C/°F>" "desc": "Imposta la temperatura della funzione Turbo [°C/°F]"
}, },
"AutoStart": { "AutoStart": {
"text2": [ "text2": [
"Avvio", "Avvio",
"automatico" "automatico"
], ],
"desc": "Attiva automaticamente il saldatore quando viene alimentato <D: disattiva; S: saldatura; R: riposo; A: temperatura ambiente>" "desc": "Attiva automaticamente il saldatore quando viene alimentato [D: disattiva; S: saldatura; R: riposo; A: temperatura ambiente]"
}, },
"CooldownBlink": { "CooldownBlink": {
"text2": [ "text2": [
@@ -199,7 +199,7 @@
"Velocità", "Velocità",
"testo" "testo"
], ],
"desc": "Imposta la velocità di scorrimento del testo <L: lento; V: veloce>" "desc": "Imposta la velocità di scorrimento del testo [L: lenta; V: veloce]"
}, },
"TipModel": { "TipModel": {
"text2": [ "text2": [
@@ -213,7 +213,7 @@
"Calibrazione", "Calibrazione",
"semplice" "semplice"
], ],
"desc": "Calibra le rilevazioni di temperatura tramite l'utilizzo di acqua calda" "desc": "Calibra le rilevazioni di temperatura tramite l'utilizzo di acqua in ebollizione"
}, },
"AdvancedCalibrationMode": { "AdvancedCalibrationMode": {
"text2": [ "text2": [
@@ -227,14 +227,14 @@
"Voltaggio", "Voltaggio",
"Quick Charge" "Quick Charge"
], ],
"desc": "Imposta il massimo voltaggio necessario alla negoziazione con un alimentatore Quick Charge" "desc": "Imposta il massimo voltaggio negoziabile con un alimentatore Quick Charge"
}, },
"PowerLimit": { "PowerLimit": {
"text2": [ "text2": [
"Limite", "Limite",
"potenza" "potenza"
], ],
"desc": "Imposta il valore di potenza massima erogabile al saldatore <watt>" "desc": "Imposta il valore di potenza massima erogabile al saldatore [watt]"
}, },
"ReverseButtonTempChange": { "ReverseButtonTempChange": {
"text2": [ "text2": [
@@ -248,21 +248,21 @@
"Temp passo", "Temp passo",
"breve" "breve"
], ],
"desc": "Imposta il «passo» dei valori di temperatura ad una breve pressione dei tasti" "desc": "Imposta il \"passo\" dei valori di temperatura per una breve pressione dei tasti"
}, },
"TempChangeLongStep": { "TempChangeLongStep": {
"text2": [ "text2": [
"Temp passo", "Temp passo",
"lungo" "lungo"
], ],
"desc": "Imposta il «passo» dei valori di temperatura ad una lunga pressione dei tasti" "desc": "Imposta il \"passo\" dei valori di temperatura per una lunga pressione dei tasti"
}, },
"PowerPulsePower": { "PowerPulsePower": {
"text2": [ "text2": [
"Potenza", "Potenza",
"impulso" "impulso"
], ],
"desc": "Regola la potenza d'impulso per prevenire lo standby eventuale dell'alimentatore <watt>" "desc": "Regola la potenza di un \"impulso sveglia\" atto a prevenire lo standby eventuale dell'alimentatore [watt]"
}, },
"TipGain": { "TipGain": {
"text2": [ "text2": [
@@ -276,49 +276,49 @@
"Effetto", "Effetto",
"Hall" "Hall"
], ],
"desc": "Regola la sensibilità alla rilevazione di supporti metallici per entrare in modalità Riposo <O: OFF; B: bassa; M: media; A: alta>" "desc": "Regola la sensibilità alla rilevazione di supporti metallici per entrare in modalità Riposo [O: OFF; B: bassa; M: media; A: alta]"
}, },
"LockingMode": { "LockingMode": {
"text2": [ "text2": [
"Blocco", "Blocco",
"tasti" "tasti"
], ],
"desc": "Blocca i tasti durante la modalità Saldatura; tieni premuto entrambi per bloccare/sbloccare <D: disattiva; T: blocca «Turbo»; C: blocco completo>" "desc": "Blocca i tasti durante la modalità Saldatura; tieni premuto entrambi per bloccare o sbloccare [D: disattiva; T: blocca Turbo; C: blocco completo]"
}, },
"MinVolCell": { "MinVolCell": {
"text2": [ "text2": [
"Minimum", "Tensione",
"voltage" "min celle"
], ],
"desc": "Minimum allowed voltage per cell <Volts> <3S — 3.0V - 3.7V, 4/5/6S — 2.4V - 3.7V>" "desc": "Modifica il valore di tensione minima \"di scaricamento\" per le celle di una batteria Li-Po [3S: 3,0-3,7 V; 4S/5S/6S: 2,4-3,7 V]"
}, },
"AnimLoop": { "AnimLoop": {
"text2": [ "text2": [
"Anim.", "Ciclo",
"loop" "animazioni"
], ],
"desc": "Loop icon animations in root menu" "desc": "Abilita la riproduzione ciclica delle animazioni del menù principale"
}, },
"AnimSpeed": { "AnimSpeed": {
"text2": [ "text2": [
"Anim.", "Velocità",
"speed" "animazioni"
], ],
"desc": "Speed of icon animations in menu <O=off | L=low | M=medium | H=high>" "desc": "Imposta la velocità di riproduzione delle animazioni del menù principale [O: OFF; L: lenta; M: media; V: veloce]"
}, },
"PowerPulseWait": { "PowerPulseWait": {
"text2": [ "text2": [
"Power pulse", "Distanza",
"wait time" "impulsi"
], ],
"desc": "Time to wait before triggering every keep-awake pulse (x 2.5s)" "desc": "Imposta il tempo che deve intercorrere tra due \"impulsi sveglia\" [multipli di 2,5 s]"
}, },
"PowerPulseDuration": { "PowerPulseDuration": {
"text2": [ "text2": [
"Power pulse", "Durata",
"duration" "impulso"
], ],
"desc": "Keep-awake-pulse duration (x 250ms)" "desc": "Regola la durata dell'«impulso sveglia» [multipli di 250 ms]"
} }
} }
} }

View File

@@ -1,2 +0,0 @@
#!/usr/bin/env bash
docker-compose run --rm builder /bin/bash /build/ci/buildAll.sh

View File

@@ -30,7 +30,7 @@ uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) {
// now we program it // now we program it
uint16_t *data = (uint16_t *)buffer; uint16_t *data = (uint16_t *)buffer;
HAL_FLASH_Unlock(); HAL_FLASH_Unlock();
for (uint8_t i = 0; i < (length / 2); i++) { for (uint16_t i = 0; i < (length / 2); i++) {
resetWatchdog(); resetWatchdog();
HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, (uint32_t)&settings_page[i], data[i]); HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, (uint32_t)&settings_page[i], data[i]);
} }

View File

@@ -26,7 +26,7 @@ uint8_t flash_save_buffer(const uint8_t *buffer, const uint16_t length) {
fmc_page_erase((uint32_t)SETTINGS_START_PAGE); fmc_page_erase((uint32_t)SETTINGS_START_PAGE);
resetWatchdog(); resetWatchdog();
uint16_t *data = (uint16_t *)buffer; uint16_t *data = (uint16_t *)buffer;
for (uint8_t i = 0; i < (length / 2); i++) { for (uint16_t i = 0; i < (length / 2); i++) {
fmc_halfword_program((uint32_t)SETTINGS_START_PAGE + (i * 2), data[i]); fmc_halfword_program((uint32_t)SETTINGS_START_PAGE + (i * 2), data[i]);
fmc_flag_clear(FMC_FLAG_END); fmc_flag_clear(FMC_FLAG_END);
fmc_flag_clear(FMC_FLAG_WPERR); fmc_flag_clear(FMC_FLAG_WPERR);

View File

@@ -213,7 +213,7 @@ PolicyEngine::policy_engine_state PolicyEngine::pe_sink_eval_cap() {
* than the maximum possible) */ * than the maximum possible) */
_pps_index = 8; _pps_index = 8;
/* Search for the first PPS APDO */ /* Search for the first PPS APDO */
for (int8_t i = 0; i < PD_NUMOBJ_GET(&tempMessage); i++) { for (int i = 0; i < PD_NUMOBJ_GET(&tempMessage); i++) {
if ((tempMessage.obj[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && (tempMessage.obj[i] & PD_APDO_TYPE) == PD_APDO_TYPE_PPS) { if ((tempMessage.obj[i] & PD_PDO_TYPE) == PD_PDO_TYPE_AUGMENTED && (tempMessage.obj[i] & PD_APDO_TYPE) == PD_APDO_TYPE_PPS) {
_pps_index = i + 1; _pps_index = i + 1;
break; break;