Skip to content

Commit

Permalink
[Update] Upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinguidee committed Apr 8, 2020
2 parents 883d131 + 2f61b82 commit 26d68c8
Show file tree
Hide file tree
Showing 18 changed files with 157 additions and 137 deletions.
6 changes: 3 additions & 3 deletions apps/graph/base.de.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Zeros = "Nullstellen"
Tangent = "Tangente"
Intersection = "Schnittmenge"
Preimage = "Urbild"
SelectLowerBound = "Untere Integrationsgrenze"
SelectUpperBound = "Obere Integrationsgrenze"
SelectLowerBound = "Untere Integrationsgrenze "
SelectUpperBound = "Obere Integrationsgrenze "
NoMaximumFound = "Kein Maximalwert gefunden"
NoMinimumFound = "Kein Mindestwert gefunden"
NoZeroFound = "Keine Nullstelle gefunden"
NoIntersectionFound = "Kein Schnittpunkt gefunden"
NoPreimageFound = "Kein Urbild gefunden"
DerivativeFunctionColumn = "Spalte der Ableitungsfunktion"
HideDerivativeColumn = "Ableitungsfunktion ausblenden"
AllowedCharactersAZaz09 = "Erlaubte Zeichen: A-Z, a-z, 0-9, _"
AllowedCharactersAZaz09 = "Erlaubte Zeichen: A..Z, a..z, 0..9, _"
ReservedName = "Reserviertes Wort"
6 changes: 3 additions & 3 deletions apps/graph/base.en.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Zeros = "Zeros"
Tangent = "Tangent"
Intersection = "Intersection"
Preimage = "Inverse image"
SelectLowerBound = "Select lower bound"
SelectUpperBound = "Select upper bound"
SelectLowerBound = "Select lower bound "
SelectUpperBound = "Select upper bound "
NoMaximumFound = "No maximum found"
NoMinimumFound = "No minimum found"
NoZeroFound = "No zero found"
NoIntersectionFound = "No intersection found"
NoPreimageFound = "No inverse image found"
DerivativeFunctionColumn = "Derivative function column"
HideDerivativeColumn = "Hide the derivative function"
AllowedCharactersAZaz09 = "Allowed characters: A-Z, a-z, 0-9, _"
AllowedCharactersAZaz09 = "Allowed characters: A.Z, a..z, 0..9, _"
ReservedName = "Reserved name"
6 changes: 3 additions & 3 deletions apps/graph/base.es.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Zeros = "Raíces"
Tangent = "Tangente"
Intersection = "Intersección"
Preimage = "Imagen inversa"
SelectLowerBound = "Seleccionar el límite inferior"
SelectUpperBound = "Seleccionar el límite superior"
SelectLowerBound = "Seleccionar el límite inferior "
SelectUpperBound = "Seleccionar el límite superior "
NoMaximumFound = "Níngun máximo encontrado"
NoMinimumFound = "Níngun mínimo encontrado"
NoZeroFound = "Ninguna raíz encontrada"
NoIntersectionFound = "Ninguna intersección encontrada"
NoPreimageFound = "Ninguna imagen inversa encontrada"
DerivativeFunctionColumn = "Columna de la derivada"
HideDerivativeColumn = "Ocultar la derivada"
AllowedCharactersAZaz09 = "Caracteres permitidos : A-Z, a-z, 0-9, _"
AllowedCharactersAZaz09 = "Caracteres permitidos : A..Z, a..z, 0..9, _"
ReservedName = "Nombre reservado"
12 changes: 6 additions & 6 deletions apps/graph/base.fr.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FunctionTab = "Fonctions"
AddFunction = "Ajouter une fonction"
DeleteFunction = "Supprimer la fonction"
CurveType = "Type de courbe"
CartesianType = "Cartésien "
CartesianType = "Cartésienne "
PolarType = "Polaire "
ParametricType = "Paramétrique "
IntervalT = "Intervalle t"
Expand All @@ -16,18 +16,18 @@ NoFunction = "Aucune fonction"
NoActivatedFunction = "Aucune fonction activée"
PlotOptions = "Options de la courbe"
Compute = "Calculer"
Zeros = "Zéros"
Zeros = "Racines"
Tangent = "Tangente"
Intersection = "Intersection"
Preimage = "Antécédent"
SelectLowerBound = "Sélectionner la borne inférieure"
SelectUpperBound = "Sélectionner la borne supérieure"
SelectLowerBound = "Sélectionner la borne inférieure "
SelectUpperBound = "Sélectionner la borne supérieure "
NoMaximumFound = "Aucun maximum trouvé"
NoMinimumFound = "Aucun minimum trouvé"
NoZeroFound = "Aucun zéro trouvé"
NoZeroFound = "Aucune racine trouvée"
NoIntersectionFound = "Aucune intersection trouvée"
NoPreimageFound = "Aucun antécédent trouvé"
DerivativeFunctionColumn = "Colonne de la fonction dérivée"
HideDerivativeColumn = "Masquer la fonction dérivée"
AllowedCharactersAZaz09 = "Caractères autorisés : A-Z, a-z, 0-9, _"
AllowedCharactersAZaz09 = "Caractères autorisés : A..Z, a..z, 0..9, _"
ReservedName = "Nom réservé"
6 changes: 3 additions & 3 deletions apps/graph/base.pt.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Zeros = "Raízes"
Tangent = "Tangente"
Intersection = "Intersecção"
Preimage = "Imagem inversa"
SelectLowerBound = "Selecionar limite superior"
SelectUpperBound = "Selecionar limite inferior"
SelectLowerBound = "Selecionar limite superior "
SelectUpperBound = "Selecionar limite inferior "
NoMaximumFound = "Nenhum máximo encontrado"
NoMinimumFound = "Nenhum mínimo encontrado"
NoZeroFound = "Nenhuma raiz encontrada"
NoIntersectionFound = "Nenhuma intersecção encontrada"
NoPreimageFound = "Nenhuma imagem inversa encontrada"
DerivativeFunctionColumn = "Coluna da função derivada"
HideDerivativeColumn = "Esconder função derivada"
AllowedCharactersAZaz09 = "Caracteres permitidos : A-Z, a-z, 0-9, _"
AllowedCharactersAZaz09 = "Caracteres permitidos : A..Z, a..z, 0..9, _"
ReservedName = "Nome reservado"
4 changes: 2 additions & 2 deletions apps/probability/base.fr.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ UniformDistribution = "Loi uniforme"
ExponentialDistribution = "Loi exponentielle"
GeometricDistribution = "Loi géométrique"
PoissonDistribution = "Loi de Poisson"
ChiSquaredDistribution = "Loi du chi2"
ChiSquaredDistribution = "Loi du Khi-2"
StudentDistribution = "Loi de Student"
FisherDistribution = "Loi de Fisher"
ChooseParameters = "Choisir les paramètres"
RepetitionNumber = "n : Nombre de répétitions"
SuccessProbability = "p : Probabilité de succès"
IntervalDefinition = "[a,b] : Intervalle"
IntervalDefinition = "[a;b] : Intervalle"
LambdaExponentialDefinition = "λ : Paramètre"
MeanDefinition = "μ : Espérance ou moyenne"
DeviationDefinition = "σ : Écart type"
Expand Down
10 changes: 5 additions & 5 deletions apps/settings/base.de.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ EditionMode = "Eingabe"
EditionLinear = "Linear "
Edition2D = "Natürlich "
ComplexFormat = "Komplex"
ExamMode = "Testmodus"
ExamModeActive = "Testmodus neustarten"
ToDeactivateExamMode1 = "Um den Testmodus auszuschalten,"
ExamMode = "Prüfungsmodus"
ExamModeActive = "Wieder starten Modus"
ToDeactivateExamMode1 = "Um den Prüfungsmodus auszuschalten,"
ToDeactivateExamMode2 = "schließen Sie den Rechner an einen"
ToDeactivateExamMode3 = "Computer oder eine Steckdose an."
# --------------------- Please do not edit these messages ---------------------
Expand All @@ -22,13 +22,13 @@ AboutWarning4 = "for any resulting damage."
# -----------------------------------------------------------------------------
About = "Über"
Degrees = "Grad "
Gradians = "Gone "
Gradians = "Gon "
Radian = "Bogenmaß "
Decimal = "Dezimal "
Engineering = "Technisch "
Scientific = "Wissenschaftlich "
SignificantFigures = "Signifikante Stellen "
Real = "Reel "
Real = "Reell "
Cartesian = "Algebraische "
Polar = "Polar "
Brightness = "Helligkeit"
Expand Down
8 changes: 4 additions & 4 deletions apps/shared.de.i18n
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ActivateDeactivate = "Aktivieren/Deaktivieren"
ActivateDutchExamMode = "Activate Dutch exam mode"
ActivateExamMode = "Starten Testmodus"
ActivateExamMode = "Starten Prüfungsmodus"
ActiveExamModeMessage1 = "Alle Ihre Daten werden "
ActiveExamModeMessage2 = "gelöscht, wenn Sie den "
ActiveExamModeMessage3 = "Testmodus einschalten."
ActiveExamModeMessage3 = "Prüfungsmodus einschalten."
ActiveDutchExamModeMessage1 = "All your data will be deleted when"
ActiveDutchExamModeMessage2 = "you activate the exam mode. Python"
ActiveDutchExamModeMessage3 = "application will be unavailable."
Expand All @@ -20,8 +20,8 @@ Deviation = "Varianz"
DisplayValues = "Werte anzeigen"
Empty = "Leer"
Eng = "tech"
ExitExamMode1 = "Möchten Sie den Testmodus "
ExitExamMode2 = "verlassen?"
ExitExamMode1 = "Möchten Sie den"
ExitExamMode2 = "Prüfungsmodus verlassen?"
Exponential = "Exponentielle"
FillWithFormula = "Mit einer Formel füllen"
ForbiddenValue = "Verbotener Wert"
Expand Down
8 changes: 4 additions & 4 deletions apps/shared/round_cursor_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

namespace Shared {

static KDColor s_cursorWorkingBuffer[Dots::LargeDotDiameter*Dots::LargeDotDiameter];

void RoundCursorView::drawRect(KDContext * ctx, KDRect rect) const {
KDRect r = bounds();
KDColor cursorWorkingBuffer[Dots::LargeDotDiameter*Dots::LargeDotDiameter];
#ifdef GRAPH_CURSOR_SPEEDUP
/* Beware that only the pixels of the intersection of rect with KDContext's
* clipping rect are pulled. All other pixels are left unaltered. Indeed
Expand All @@ -15,7 +14,7 @@ void RoundCursorView::drawRect(KDContext * ctx, KDRect rect) const {
ctx->getPixels(r, m_underneathPixelBuffer);
m_underneathPixelBufferLoaded = true;
#endif
ctx->blendRectWithMask(r, m_color, (const uint8_t *)Dots::LargeDotMask, s_cursorWorkingBuffer);
ctx->blendRectWithMask(r, m_color, (const uint8_t *)Dots::LargeDotMask, cursorWorkingBuffer);
}

KDSize RoundCursorView::minimalSizeForOptimalDisplay() const {
Expand Down Expand Up @@ -67,10 +66,11 @@ bool RoundCursorView::eraseCursorIfPossible() {
return false;
}
// Erase the cursor
KDColor cursorWorkingBuffer[Dots::LargeDotDiameter*Dots::LargeDotDiameter];
KDContext * ctx = KDIonContext::sharedContext();
ctx->setOrigin(currentFrame.origin());
ctx->setClippingRect(currentFrame);
ctx->fillRectWithPixels(KDRect(0,0,k_cursorSize, k_cursorSize), m_underneathPixelBuffer, s_cursorWorkingBuffer);
ctx->fillRectWithPixels(KDRect(0,0,k_cursorSize, k_cursorSize), m_underneathPixelBuffer, cursorWorkingBuffer);
// TODO Restore the context to previous values?
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions apps/usb/base.fr.i18n
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ USBConnected = "LA CALCULATRICE EST CONNECTÉE"
ConnectedMessage1 = "Pour transférer des données, connectez-"
ConnectedMessage2 = "vous depuis votre ordinateur sur le site"
ConnectedMessage3 = "workshop.numworks.com"
ConnectedMessage4 = "Appuyez sur la touche RETOUR de la"
ConnectedMessage5 = "calculatrice ou débranchez-la pour la"
ConnectedMessage6 = "déconnecter."
ConnectedMessage4 = "Appuyez sur la touche RETOUR"
ConnectedMessage5 = "de la calculatrice ou débranchez-la"
ConnectedMessage6 = "pour la déconnecter."
117 changes: 46 additions & 71 deletions build/device/ram_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,86 +4,61 @@
import subprocess
import sys
import matplotlib.pyplot as plt
import random
from matplotlib.ticker import FormatStrFormatter

def filter_set(data, pred):
result = {}
for k,v in data.items():
if (pred(v)):
result[k] = v
return result
readelf_line_regex = re.compile("[0-9]+:\s+([0-9a-f]+)\s+([0-9]+)\s+[A-Z]+")
def parse_line(line):
hex_start, dec_size = re.findall(readelf_line_regex, line)[0]
return (int(hex_start, 16), int(dec_size))

def pred_ram(symbol):
return (symbol[0] >= 0x20000000) and (symbol[0] <= 0x20040000)
readelf_output = subprocess.check_output([
"arm-none-eabi-readelf",
"-W", # Don't limit line lenght
"-s", # Sizes
sys.argv[1]
]).decode('utf-8')

def pred_size(symbol):
return (symbol[1] >= 64)
for line in readelf_output.splitlines():
words = line.split()
if not words:
continue
symbol = words[-1]
if symbol == "_ZN3Ion17staticStorageAreaE":
storage = parse_line(line)
if symbol == "_ZZN13AppsContainer19sharedAppsContainerEvE20appsContainerStorage":
container = parse_line(line)
if symbol == "_stack_start":
stack_start, _ = parse_line(line)
if symbol == "_stack_end":
stack_end, _ = parse_line(line)
if symbol == "_heap_start":
heap_start, _ = parse_line(line)
if symbol == "_heap_end":
heap_end, _ = parse_line(line)

def load_symbols(filename):
nm_output = subprocess.check_output([
"arm-none-eabi-nm",
"--print-size",
filename
]).decode('utf-8').splitlines()
nm_symbol_regex = re.compile("^([0-9A-Fa-f]+) ([0-9A-Fa-f]+) (.) (.+)$")
nm_sizeless_regex = re.compile("^([0-9a-z]+) (.) (.+)$")
symbol_results = [ re.match(nm_symbol_regex, line).groups() for line in nm_output if re.match(nm_symbol_regex, line) ]
sizeless_results = [ re.match(nm_sizeless_regex, line).groups() for line in nm_output if re.match(nm_sizeless_regex, line) ]
results = {}
for result in symbol_results:
results[result[3]] = ((int(result[0],16),int(result[1],16),result[2],result[3]))
for result in sizeless_results:
results[result[2]] = ((int(result[0],16),0,result[1],result[2]))
# Fixup stack and heap
for i in (("_stack_start", "_stack_end", "_stack"), ("_heap_start", "_heap_end", "_heap")):
if i[0] in results and i[1] in results:
start = results[i[0]]
end = results[i[1]]
results[i[2]] = (min(start[0], end[0]), abs(end[0]-start[0]), start[2], i[2])
del results[i[0]]
del results[i[1]]
return results

def demangle_symbols(symbols):
symbol_names = []
for name in symbols.keys():
symbol_names.append(name)
symbols_encoded = "\n".join(symbol_names).encode('utf-8')
demangled_output = subprocess.check_output(["c++filt"], input=symbols_encoded).decode('utf-8').splitlines()
demangled_symbols = {}
cpt=0
for symbol in symbols.values():
demangled_symbols[demangled_output[cpt]] = (symbol[0], symbol[1], symbol[2], demangled_output[cpt])
cpt += 1
return demangled_symbols
stack_size = stack_start - stack_end # Stack grows downwards
stack = (stack_end, stack_size)
heap_size = heap_end - heap_start
heap = (heap_start, heap_size)

def format_kb(i):
return ("%.3f KiB" % (i/1024))
return ("%d KB" % (i/1024))

def plot_symbols(symbols, range_start, range_end):
fig,ax = plt.subplots()
cpt = 0
for symbol in symbols.values():
symbol_name = symbol[3].lstrip("_")
symbol_color=(random.uniform(0,1),random.uniform(0,1),random.uniform(0,1))
ax.broken_barh([(symbol[0], symbol[1])], (0, 1), color=symbol_color, label=symbol_name + " - " + format_kb(symbol[1]))
cpt += 1
ax.set_yticks([])
ax.set_xticks(list(range(range_start, range_end+1, int((range_end-range_start)/16))))
xlabels = map(lambda t: '0x%08X' % int(t), ax.get_xticks())
ax.set_xticklabels(xlabels);
ax.legend()
fig.set_size_inches(20, 2)
return fig
fig,ax = plt.subplots()

data=load_symbols(sys.argv[1])
data=demangle_symbols(data)
data = filter_set(data, pred_ram)
data = filter_set(data, pred_size)
def plot(value, name, c):
ax.broken_barh([value], (0, 1), color=c, label=name + " - " + format_kb(value[1]))

fig=plot_symbols(data,0x20000000,0x20040000)
plot(container, "Container", "blue")
plot(storage, "Storage", "red")
plot(heap, "Heap", "pink")
plot(stack, "Stack", "green")

fig.show()
input()
ax.set_yticks([])
ax.set_xticks(list(range(0x20000000,0x20040001,0x10000)))
xlabels = map(lambda t: '0x%08X' % int(t), ax.get_xticks())
ax.set_xticklabels(xlabels);
ax.legend()
fig.set_size_inches(20, 2)
fig.savefig(sys.argv[2])

2 changes: 1 addition & 1 deletion build/helpers.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ define rule_for_arch_executable
.PRECIOUS: $$(BUILD_DIR)/$(1)/%.$$(EXE)
$$(BUILD_DIR)/$(1)/%.$$(EXE): force_remake
$(Q) echo "MAKE ARCH=$(1)"
$(Q) $$(MAKE) ARCH=$(1) --silent $$*.$$(EXE)
$(Q) $$(MAKE) ARCH=$(1) $$*.$$(EXE)
endef

$(foreach ARCH,$(ARCHS),$(eval $(call rule_for_arch_executable,$(ARCH))))
Expand Down
6 changes: 6 additions & 0 deletions build/targets.device.mak
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ HANDY_TARGETS_EXTENSIONS += dfu hex bin

%_ram_map: %.$(EXE)
$(PYTHON) build/device/ram_map.py $(BUILD_DIR)/$<

$(eval $(call rule_for, \
RAMSIZE, %_ram_map.png, %.elf, \
$$(PYTHON) build/device/ram_map.py $$< $$@, \
local \
))

.PHONY: %_size
%_size: $(BUILD_DIR)/%.$(EXE)
Expand Down
Loading

0 comments on commit 26d68c8

Please sign in to comment.