From f352bb701902db2cd28507a84d1793dd499be3c1 Mon Sep 17 00:00:00 2001 From: odudex Date: Wed, 27 Nov 2024 11:23:46 -0300 Subject: [PATCH] Flash Map: Smother and more stable drawing --- mkdocs.yml | 2 +- pyproject.toml | 2 +- src/krux/metadata.py | 2 +- src/krux/pages/flash_tools.py | 15 +++++++++++---- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index 2dce5c4c..9ea694ea 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -51,7 +51,7 @@ edit_uri: edit/main/docs docs_dir: docs site_dir: public extra: - latest_krux: krux-v25.01.beta0 + latest_krux: krux-v25.01.beta1 latest_installer: v0.0.20-beta latest_installer_rpm: krux-installer-0.0.20_beta-1.x86_64.rpm latest_installer_deb: krux-installer_0.0.20-beta_amd64.deb diff --git a/pyproject.toml b/pyproject.toml index 477011a2..304a94c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ [tool.poetry] name = "krux" -version = "25.01.beta0" +version = "25.01.beta1" description = "Open-source signing device firmware for Bitcoin" authors = ["Jeff S "] diff --git a/src/krux/metadata.py b/src/krux/metadata.py index 05afef21..100a129e 100644 --- a/src/krux/metadata.py +++ b/src/krux/metadata.py @@ -19,5 +19,5 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -VERSION = "25.01.beta0" +VERSION = "25.01.beta1" SIGNER_PUBKEY = "03339e883157e45891e61ca9df4cd3bb895ef32d475b8e793559ea10a36766689b" diff --git a/src/krux/pages/flash_tools.py b/src/krux/pages/flash_tools.py index 10f72337..7e1913f7 100644 --- a/src/krux/pages/flash_tools.py +++ b/src/krux/pages/flash_tools.py @@ -55,6 +55,7 @@ def flash_tools_menu(self): def flash_map(self): """Load the flash map page""" import flash + import image image_block_size = self.ctx.display.width() // FLASH_ROWS if self.ctx.display.width() >= self.ctx.display.height(): @@ -113,19 +114,25 @@ def flash_map(self): ) # Draw a map of the flash memory + mem_bar = image.Image(size=(FLASH_ROWS * image_block_size, image_block_size)) for address in range(0, FLASH_SIZE, BLOCK_SIZE): wdt.feed() color = theme.highlight_color if address < SPIFFS_ADDR else theme.fg_color if flash.read(address, BLOCK_SIZE) == empty_buf: color = theme.disabled_color # Draw the block - x_pos = offset_x + column * image_block_size - y_pos = offset_y + row * image_block_size - self.ctx.display.fill_rectangle( - x_pos, y_pos, image_block_size, image_block_size, color + mem_bar.draw_rectangle( + column * image_block_size, + 0, + image_block_size, + image_block_size, + color, + fill=True, ) column += 1 if column >= FLASH_ROWS: + y_pos = offset_y + row * image_block_size + lcd.display(mem_bar, oft=(offset_x, y_pos)) column = 0 row += 1 self.ctx.input.reset_ios_state()