summaryrefslogtreecommitdiff
path: root/firmware/export/system.h
diff options
context:
space:
mode:
authorJames Buren <braewoods+rb@braewoods.net>2020-11-11 10:54:05 +0000
committerJames Buren <braewoods+rb@braewoods.net>2020-11-11 13:30:09 +0000
commit4aa749b59db9fb46a47a0bcff4f19a6f0552b2aa (patch)
tree39784c771741613847e83dce95b122f27cf485e6 /firmware/export/system.h
parentc4254d10fc61779656dd5692c2f6333692ba73f8 (diff)
downloadrockbox-4aa749b59db9fb46a47a0bcff4f19a6f0552b2aa.tar.gz
rockbox-4aa749b59db9fb46a47a0bcff4f19a6f0552b2aa.zip
iriver_flash: refactor code to be easier to understand
This overhauls most of the code to be easier to understand in terms of the interactions with the flash. I found the original to be rather confusing with how it kept switching between byte and word offsets. My solution was to make all external access to the flash in terms of sectors and bytes. Whatever the flash uses internally is now handled by the subroutines for performing the erase, program, and verify operations. This helps make it far more consistent for the code that actually uses these operations as they do not need to concern themselves with word sizes and offsets anymore. As a side effect of this change the flash operations are now done entirely by subroutines; even the batch operations that used to use custom loops. Additionally some functions were merged with other functions in order to reduce the amount of functions as well as consolidating common code fragments. Change-Id: I4698e920a226a3bbe8070004a14e5848abdd70ec
Diffstat (limited to 'firmware/export/system.h')
-rw-r--r--firmware/export/system.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h
index 1885acfffd..68d7958870 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -36,8 +36,8 @@ extern void system_init(void);
36extern long cpu_frequency; 36extern long cpu_frequency;
37 37
38struct flash_header { 38struct flash_header {
39 unsigned long magic; 39 uint32_t magic;
40 unsigned long length; 40 uint32_t length;
41 char version[32]; 41 char version[32];
42}; 42};
43 43