8000 fix instruction: adc (3rd arg is mux, not pad) · pvr1/py-esp32-ulp@b13e3da · GitHub
[go: up one dir, main page]

Skip to content

Commit b13e3da

Browse files
fix instruction: adc (3rd arg is mux, not pad)
this might be wrong in ulp.h as the wrong implementation was inspired from that. the tech ref and the prog guide both talk about the mux (not the pad).
1 parent 7eec001 commit b13e3da

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

esp32_ulp/opcodes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,9 @@ def i_wait(cycles):
378378
return _delay.all
379379

380380

381-
def i_adc(reg_dest, adc_idx, pad_idx):
381+
def i_adc(reg_dest, adc_idx, mux):
382382
_adc.dreg = get_reg(reg_dest)
383-
_adc.mux = get_imm(pad_idx) + 1
383+
_adc.mux = get_imm(mux)
384384
_adc.sar_sel = get_imm(adc_idx)
385385
_adc.unused1 = 0
386386
_adc.cycles = 0

tests/compat/io.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
i2c_rd 0x10, 7, 0, 0
77
i2c_wr 0x23, 0x42, 7, 0, 1
88

9-
adc r0, 0, 1
9+
adc r0, 1, 2

0 commit comments

Comments
 (0)
0