Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
firmware
Compare revisions
master to master
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
derf/firmware
Select target project
No results found
master
Select Git revision
Branches
ch3/api-speed-eval2
ch3/dual-core
ch3/genapi-refactor
ch3/leds-api
ch3/splashscreen
dualcore
freertos-btle
genofire/leds_rgb_get_state
genofire/rockets-state
hauke/ble-cleanups
ios-workarounds
koalo/bhi160-works-but-dirty
koalo/factory-reset
koalo/wip/i2c-for-python
master
msgctl/faultscreen
msgctl/gfx_rle
msgctl/textbuffer_api
plaetzchen/ios-workaround
rahix/bhi
rahix/bma
rahix/simple_menu
renze/hatchery_apps
renze/safe_mode
schleicher-test
schneider/ble-buffers
schneider/bonding
schneider/bootloader-update-9a0d158
schneider/bsec
schneider/fundamental-test
schneider/max30001
schneider/max30001-epicaridum
schneider/max30001-pycardium
schneider/maxim-sdk-update
schneider/mp-for-old-bl
schneider/schleicher-test
schneider/stream-locks
Tags
bootloader-v1
release-1
v0.0
v1.0
v1.1
v1.2
v1.3
v1.4
v1.5
v1.6
47 results
Swap
Target
card10/firmware
Select target project
card10/firmware
annejan/firmware
astro/firmware
fpletz/firmware
gerd/firmware
fleur/firmware
swym/firmware
l/firmware
uberardy/firmware
wink/firmware
madonius/firmware
mot/firmware
filid/firmware
q3k/firmware
hauke/firmware
Woazboat/firmware
pink/firmware
mossmann/firmware
omniskop/firmware
zenox/firmware
trilader/firmware
Danukeru/firmware
shoragan/firmware
zlatko/firmware
sistason/firmware
datenwolf/firmware
bene/firmware
amedee/firmware
martinling/firmware
griffon/firmware
chris007/firmware
adisbladis/firmware
dbrgn/firmware
jelly/firmware
rnestler/firmware
mh/firmware
ln/firmware
penguineer/firmware
monkeydom/firmware
jens/firmware
jnaulty/firmware
jeffmakes/firmware
marekventur/firmware
pete/firmware
h2obrain/firmware
DooMMasteR/firmware
jackie/firmware
prof_r/firmware
Draradech/firmware
Kartoffel/firmware
hinerk/firmware
abbradar/firmware
JustTB/firmware
LuKaRo/firmware
iggy/firmware
ente/firmware
flgr/firmware
Lorphos/firmware
matejo/firmware
ceddral7/firmware
danb/firmware
joshi/firmware
melle/firmware
fitch/firmware
deurknop/firmware
sargon/firmware
markus/firmware
kloenk/firmware
lucaswerkmeister/firmware
derf/firmware
meh/firmware
dx/card10-firmware
torben/firmware
yuvadm/firmware
AndyBS/firmware
klausdieter1/firmware
katzenparadoxon/firmware
xiretza/firmware
ole/firmware
techy/firmware
thor77/firmware
TilCreator/firmware
fuchsi/firmware
dos/firmware
yrlf/firmware
PetePriority/firmware
SuperVirus/firmware
sur5r/firmware
tazz/firmware
Alienmaster/firmware
flo_h/firmware
baldo/firmware
mmu_man/firmware
Foaly/firmware
sodoku/firmware
Guinness/firmware
ssp/firmware
led02/firmware
Stormwind/firmware
arist/firmware
coon/firmware
mdik/firmware
pippin/firmware
royrobotiks/firmware
zigot83/firmware
mo_k/firmware
106 results
master
Select Git revision
Branches
add_menu_vibration
blinkisync-as-preload
ch3/api-speed-eval2
ch3/dual-core
ch3/genapi-refactor
ch3/leds-api
ch3/splashscreen
dualcore
dx/flatten-config-module
dx/meh-bdf-to-stm
freertos-btle
genofire/ble-follow-py
koalo/bhi160-works-but-dirty
koalo/factory-reset
koalo/wip/i2c-for-python
master
msgctl/faultscreen
msgctl/textbuffer_api
plaetzchen/ios-workaround
rahix/bhi
rahix/bluetooth-app-favorite
rahix/bma
rahix/user-space-ctx
renze/hatchery_apps
renze/safe_mode
schleicher-test
schneider/212-reset-hardware-when-entering-repl
schneider/ancs
schneider/ble-buffers
schneider/ble-central
schneider/ble-ecg-stream-visu
schneider/ble-fixes-2020-3
schneider/ble-mini-demo
schneider/ble-stability
schneider/ble-stability-new-phy
schneider/bonding
schneider/bonding-fail-if-full
schneider/bootloader-update-9a0d158
schneider/deepsleep
schneider/deepsleep2
schneider/deepsleep4
schneider/default-main
schneider/freertos-list-debug
schneider/fundamental-test
schneider/iaq-python
schneider/ir
schneider/max30001
schneider/max30001-epicaridum
schneider/max30001-pycardium
schneider/maxim-sdk-update
schneider/mp-exception-print
schneider/mp-for-old-bl
schneider/png
schneider/schleicher-test
schneider/sdk-0.2.1-11
schneider/sdk-0.2.1-7
schneider/sleep-display
schneider/spo2-playground
schneider/stream-locks
schneider/v1.17-changelog
Tags
bootloader-v1
release-1
v0.0
v1.0
v1.1
v1.10
v1.11
v1.12
v1.13
v1.14
v1.15
v1.16
v1.17
v1.18
v1.2
v1.3
v1.4
v1.5
v1.6
v1.7
v1.8
v1.9
82 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source
1
feat(card10_nickname): indicate battery voltage in symbol
· 11e51c13
Daniel Friesel
authored
Aug 24, 2019
full == filled symbol, near empty == empty battery symbol, etc.
11e51c13
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
preload/apps/card10_nickname/__init__.py
+12
-7
12 additions, 7 deletions
preload/apps/card10_nickname/__init__.py
with
12 additions
and
7 deletions
preload/apps/card10_nickname/__init__.py
View file @
11e51c13
...
@@ -80,17 +80,17 @@ def get_bat_color(bat):
...
@@ -80,17 +80,17 @@ def get_bat_color(bat):
Voltage threshold
'
s are currently estimates as voltage isn
'
t that great of an indicator for
Voltage threshold
'
s are currently estimates as voltage isn
'
t that great of an indicator for
battery charge.
battery charge.
:param bat: battery config tuple (boolean: indicator on/off, array: good rgb, array: ok rgb, array: bad rgb)
:param bat: battery config tuple (boolean: indicator on/off, array: good rgb, array: ok rgb, array: bad rgb)
:return: false if old firmware, RGB color array otherwise
:return:
battery status tuple (float: battery voltage,
false if old firmware, RGB color array otherwise
)
"""
"""
try
:
try
:
v
=
os
.
read_battery
()
v
=
os
.
read_battery
()
if
v
>
3.8
:
if
v
>
3.8
:
return
bat
[
1
]
return
(
v
,
bat
[
1
]
)
if
v
>
3.6
:
if
v
>
3.6
:
return
bat
[
2
]
return
(
v
,
bat
[
2
]
)
return
bat
[
3
]
return
(
v
,
bat
[
3
]
)
except
AttributeError
:
except
AttributeError
:
return
False
return
(
0
,
False
)
def
render_battery
(
disp
,
bat
):
def
render_battery
(
disp
,
bat
):
...
@@ -100,10 +100,15 @@ def render_battery(disp, bat):
...
@@ -100,10 +100,15 @@ def render_battery(disp, bat):
:param disp: open display
:param disp: open display
:param bat: battery config tuple (boolean: indicator on/off, array: good rgb, array: ok rgb, array: bad rgb)
:param bat: battery config tuple (boolean: indicator on/off, array: good rgb, array: ok rgb, array: bad rgb)
"""
"""
c
=
get_bat_color
(
bat
)
v
,
c
=
get_bat_color
(
bat
)
if
not
c
:
if
not
c
:
return
return
if
v
>
4.0
:
disp
.
rect
(
140
,
2
,
155
,
9
,
filled
=
True
,
col
=
c
)
disp
.
rect
(
140
,
2
,
155
,
9
,
filled
=
True
,
col
=
c
)
else
:
disp
.
rect
(
140
,
2
,
155
,
9
,
filled
=
False
,
col
=
c
)
if
v
>
3.5
:
disp
.
rect
(
141
,
3
,
142
+
int
((
v
-
3.5
)
*
24
),
9
,
filled
=
True
,
col
=
c
)
disp
.
rect
(
155
,
4
,
157
,
7
,
filled
=
True
,
col
=
c
)
disp
.
rect
(
155
,
4
,
157
,
7
,
filled
=
True
,
col
=
c
)
...
...
This diff is collapsed.
Click to expand it.