Skip to content

Commit

Permalink
Flash Map: Smother and more stable drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
odudex committed Nov 27, 2024
1 parent 8e53f16 commit f352bb7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"]

Expand Down
2 changes: 1 addition & 1 deletion src/krux/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
15 changes: 11 additions & 4 deletions src/krux/pages/flash_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit f352bb7

Please sign in to comment.