Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r 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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dos
flow3r firmware
Commits
372cb56a
Commit
372cb56a
authored
1 year ago
by
ave
Browse files
Options
Downloads
Patches
Plain Diff
updat3r: regex the version string instead
parent
f09f8973
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+10
-0
10 additions, 0 deletions
CHANGELOG.md
python_payload/apps/updat3r/__init__.py
+9
-7
9 additions, 7 deletions
python_payload/apps/updat3r/__init__.py
with
19 additions
and
7 deletions
CHANGELOG.md
+
10
−
0
View file @
372cb56a
...
@@ -4,10 +4,20 @@ All notable changes to this project will be documented in this file.
...
@@ -4,10 +4,20 @@ All notable changes to this project will be documented in this file.
The format is based on
[
Keep a Changelog
](
https://keepachangelog.com/en/1.0.0/
)
.
The format is based on
[
Keep a Changelog
](
https://keepachangelog.com/en/1.0.0/
)
.
## [Unreleased]
### Added
### Changed
### Fixed
-
updat3r: Improved version comparison logic, making the "you are up to date :)" logic work
## [1.3.0] - 2023-11-26
## [1.3.0] - 2023-11-26
### Summary
### Summary
-
Wifi connection UI
-
Wifi connection UI
-
Media framework
-
Media framework
-
SD card works reliably
-
Performance improvements
-
Performance improvements
-
Backend improvements
-
Backend improvements
-
Wider micropython API
-
Wider micropython API
...
...
This diff is collapsed.
Click to expand it.
python_payload/apps/updat3r/__init__.py
+
9
−
7
View file @
372cb56a
...
@@ -7,6 +7,7 @@ import sys_kernel
...
@@ -7,6 +7,7 @@ import sys_kernel
import
urequests
import
urequests
import
math
import
math
import
sys
import
sys
import
re
from
st3m.ui.view
import
ViewManager
from
st3m.ui.view
import
ViewManager
import
st3m.wifi
import
st3m.wifi
...
@@ -62,11 +63,15 @@ class UpdaterApp(Application):
...
@@ -62,11 +63,15 @@ class UpdaterApp(Application):
ctx
.
move_to
(
0
,
55
)
ctx
.
move_to
(
0
,
55
)
ctx
.
text
(
"
enter Wi-Fi settings
"
)
ctx
.
text
(
"
enter Wi-Fi settings
"
)
def
version_to_number
(
self
,
version
:
str
):
def
version_to_number
(
self
,
version
_raw
:
str
):
if
"
dev
"
in
version
:
if
"
dev
"
in
version
_raw
:
return
0
return
0
major
,
minor
,
patch
=
version
.
split
(
"
.
"
)
version_re
=
re
.
search
(
"
[0-9]+.[0-9]+.[0-9]+
"
,
version_raw
)
if
not
version_re
:
return
0
major
,
minor
,
patch
=
version_re
.
group
(
0
).
split
(
"
.
"
)
try
:
try
:
version_number
=
(
int
(
major
)
*
1000000
)
+
(
int
(
major
)
*
1000
)
+
int
(
patch
)
version_number
=
(
int
(
major
)
*
1000000
)
+
(
int
(
major
)
*
1000
)
+
int
(
patch
)
...
@@ -151,9 +156,7 @@ class UpdaterApp(Application):
...
@@ -151,9 +156,7 @@ class UpdaterApp(Application):
self
.
_state_text
=
"
latest dev build
\n\n
press app shoulder button
\n
to start downloading
\n\n
(tilt shoulder left to
\n
switch to latest version)
"
self
.
_state_text
=
"
latest dev build
\n\n
press app shoulder button
\n
to start downloading
\n\n
(tilt shoulder left to
\n
switch to latest version)
"
elif
self
.
fetched_version
:
elif
self
.
fetched_version
:
self
.
selected_version
=
self
.
fetched_version
[
0
]
self
.
selected_version
=
self
.
fetched_version
[
0
]
latest_version_number
=
self
.
version_to_number
(
latest_version_number
=
self
.
version_to_number
(
self
.
selected_version
[
"
tag
"
])
self
.
selected_version
[
"
tag
"
].
replace
(
"
v
"
,
""
)
)
self
.
_state_text
=
f
"
latest version:
\n
{
self
.
selected_version
[
'
name
'
]
}
"
self
.
_state_text
=
f
"
latest version:
\n
{
self
.
selected_version
[
'
name
'
]
}
"
if
latest_version_number
>
self
.
_firmware_version_number
:
if
latest_version_number
>
self
.
_firmware_version_number
:
self
.
_state_text
+=
(
self
.
_state_text
+=
(
...
@@ -168,7 +171,6 @@ class UpdaterApp(Application):
...
@@ -168,7 +171,6 @@ class UpdaterApp(Application):
super
().
think
(
ins
,
delta_ms
)
super
().
think
(
ins
,
delta_ms
)
# TODO: verify hash
# TODO: verify hash
# TODO: download percentage
if
self
.
input
.
buttons
.
app
.
right
.
pressed
:
if
self
.
input
.
buttons
.
app
.
right
.
pressed
:
self
.
use_dev_version
=
True
self
.
use_dev_version
=
True
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment