Skip to content

Commit

Permalink
Merge pull request #160 from BlueSCSI/piologicfix
Browse files Browse the repository at this point in the history
PIO base file did not match compiled PIO header file
  • Loading branch information
erichelgeson authored Jul 6, 2024
2 parents 19633f4 + 83c6797 commit df274ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/BlueSCSI_platform_RP2040/rp2040_sdio.pio
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
; edge, it is preferrable to have a long 0 state and short 1 state.
;.define CLKDIV 3
.define CLKDIV 5
.define D0 ((CLKDIV + 1) / 2 - 1)
.define D1 (CLKDIV/2 - 1)
.define D0 (((CLKDIV + 1) /2) - 1)
.define D1 ((CLKDIV/2) - 1)
.define SDIO_CLK_GPIO 10

; State machine 0 is used to:
Expand Down
9 changes: 3 additions & 6 deletions lib/BlueSCSI_platform_RP2040/rp2040_sdio.pio.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ static const uint16_t sdio_data_rx_program_instructions[] = {
// .wrap_target
0xa022, // 0: mov x, y
0x2020, // 1: wait 0 pin, 0
//0x2492, // 2: wait 1 gpio, 18 [4]
0x248A, // 2: wait 1 gpio 10
0x248a, // 2: wait 1 gpio, 10 [4]
0x4304, // 3: in pins, 4 [3]
0x0043, // 4: jmp x--, 3
// .wrap
Expand Down Expand Up @@ -93,10 +92,8 @@ static inline pio_sm_config sdio_data_rx_program_get_default_config(uint offset)
#define sdio_data_tx_wrap 8

static const uint16_t sdio_data_tx_program_instructions[] = {
// 0x2012, // 0: wait 0 gpio, 18
0x200A, // 0: wait 0 GPIO 10
// 0x2592, // 1: wait 1 gpio, 18 [5]
0x258A, // 1: wait 1 gpio 10
0x200a, // 0: wait 0 gpio, 10
0x258a, // 1: wait 1 gpio, 10 [5]
0x6204, // 2: out pins, 4 [2]
0x0142, // 3: jmp x--, 2 [1]
0xe280, // 4: set pindirs, 0 [2]
Expand Down

0 comments on commit df274ea

Please sign in to comment.