File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
ports/raspberrypi/common-hal/memorymap Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -94,9 +94,9 @@ void common_hal_memorymap_addressrange_set_bytes(const memorymap_addressrange_ob
94
94
} else {
95
95
// Aligned access and length, use 32-bit writes
96
96
uint32_t * dest_addr32 = (uint32_t * )dest_addr ;
97
- size_t len32 = len >> 2 ;
98
- for (size_t i = 0 ; i < len32 ; i ++ ) {
99
- * dest_addr32 ++ = ((uint32_t * )values )[i << 2 ];
97
+ size_t access_count = len >> 2 ;
98
+ for (size_t i = 0 ; i < access_count ; i ++ ) {
99
+ * dest_addr32 ++ = ((uint32_t * )values )[i ];
100
100
}
101
101
}
102
102
break ;
@@ -124,10 +124,10 @@ void common_hal_memorymap_addressrange_get_bytes(const memorymap_addressrange_ob
124
124
// Unaligned access or unaligned length not supported by RP2 for IO registers
125
125
mp_raise_RuntimeError (translate ("Unable to access unaliged IO register" ));
126
126
} else {
127
- // Aligned access and length, use 32-bit writes
127
+ // Aligned access and length, use 32-bit reads
128
128
uint32_t * src_addr32 = (uint32_t * )src_addr ;
129
- size_t len32 = len >> 2 ;
130
- for (size_t i = 0 ; i < len32 ; i ++ ) {
129
+ size_t access_count = len >> 2 ;
130
+ for (size_t i = 0 ; i < access_count ; i ++ ) {
131
131
((uint32_t * )values )[i ] = * src_addr32 ++ ;
132
132
}
133
133
}
You can’t perform that action at this time.
0 commit comments