Skip to content

Commit e3ba430

Browse files
MichaelBellGadgetoid
authored andcommitted
ports/rp2: Possible PSRAM fix.
Signed-off-by: Phil Howard <github@gadgetoid.com>
1 parent c98c139 commit e3ba430

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ports/rp2/rp2_psram.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
size_t __no_inline_not_in_flash_func(psram_detect)() {
1010
int psram_size = 0;
1111

12-
uint32_t intr_stash = save_and_disable_interrupts();
13-
1412
// Try and read the PSRAM ID via direct_csr.
1513
qmi_hw->direct_csr = 30 << QMI_DIRECT_CSR_CLKDIV_LSB | QMI_DIRECT_CSR_EN_BITS;
1614

@@ -76,13 +74,14 @@ size_t __no_inline_not_in_flash_func(psram_detect)() {
7674
}
7775
}
7876

79-
restore_interrupts(intr_stash);
8077
return psram_size;
8178
}
8279

8380
size_t __no_inline_not_in_flash_func(psram_init)(uint cs_pin) {
8481
gpio_set_function(cs_pin, GPIO_FUNC_XIP_CS1);
8582

83+
uint32_t intr_stash = save_and_disable_interrupts();
84+
8685
size_t psram_size = psram_detect();
8786

8887
if (!psram_size) {
@@ -162,5 +161,7 @@ size_t __no_inline_not_in_flash_func(psram_init)(uint cs_pin) {
162161
// Enable writes to PSRAM
163162
hw_set_bits(&xip_ctrl_hw->ctrl, XIP_CTRL_WRITABLE_M1_BITS);
164163

164+
restore_interrupts(intr_stash);
165+
165166
return psram_size;
166167
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy