Skip to content

Commit 2d30b67

Browse files
committed
fix a problem with the addressrange example
The old offset was for "atomic bitmask clear on write" not "atomic XOR on write".
1 parent 14ef837 commit 2d30b67

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

shared-bindings/memorymap/AddressRange.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
//| # Pad control register is updated using an MP-safe atomic XOR
4040
//| pad_ctrl ^= (d << 4)
4141
//| pad_ctrl &= 0x00000030
42-
//| pads_bank0[p*4+0x3004:p*4+0x3008] = pad_ctrl.to_bytes(4, "little")
42+
//| pads_bank0[p*4+0x1004:p*4+0x1008] = pad_ctrl.to_bytes(4, "little")
4343
//|
4444
//| def rp2040_get_pad_drive(p):
4545
//| pads_bank0 = memorymap.AddressRange(start=0x4001C000, length=0x4000)
@@ -51,6 +51,10 @@
5151
//|
5252
//| # print GPIO16 pad drive strength
5353
//| print(rp2040_get_pad_drive(16))
54+
//|
55+
//| Note that the above example does **not** work on RP2350 because base
56+
//| address and organization of the "pads0" registers changed compared
57+
//| to the RP2040.
5458
//| """
5559
//|
5660

0 commit comments

Comments
 (0)