diff options
Diffstat (limited to 'fw/fe310/eos/eve')
-rw-r--r-- | fw/fe310/eos/eve/eve.c | 26 | ||||
-rw-r--r-- | fw/fe310/eos/eve/eve.h | 3 |
2 files changed, 17 insertions, 12 deletions
diff --git a/fw/fe310/eos/eve/eve.c b/fw/fe310/eos/eve/eve.c index 5103e5f..7f77190 100644 --- a/fw/fe310/eos/eve/eve.c +++ b/fw/fe310/eos/eve/eve.c @@ -256,17 +256,7 @@ int eve_cmd_done(void) { uint16_t r = eve_read16(REG_CMD_READ); if (r == 0xfff) { - uint16_t ptr; - - cmd_offset = 0; - ptr = eve_read16(REG_COPRO_PATCH_PTR); - eve_write8(REG_CPURESET, 1); - eve_write16(REG_CMD_READ, 0); - eve_write16(REG_CMD_WRITE, 0); - eve_write16(REG_CMD_DL, 0); - eve_write8(REG_CPURESET, 0); - eve_write16(REG_COPRO_PATCH_PTR, ptr); - eve_write8(REG_PCLK, EVE_PCLK); + eve_copro_reset(); return EVE_ERR; } @@ -486,3 +476,17 @@ void eve_brightness(uint8_t b) { void eve_lcd_absent(void) { lcd_absent = 1; } + +void eve_copro_reset(void) { + uint16_t ptr; + + cmd_offset = 0; + ptr = eve_read16(REG_COPRO_PATCH_PTR); + eve_write8(REG_CPURESET, 1); + eve_write16(REG_CMD_READ, 0); + eve_write16(REG_CMD_WRITE, 0); + eve_write16(REG_CMD_DL, 0); + eve_write8(REG_CPURESET, 0); + eve_write16(REG_COPRO_PATCH_PTR, ptr); + eve_write8(REG_PCLK, EVE_PCLK); +} diff --git a/fw/fe310/eos/eve/eve.h b/fw/fe310/eos/eve/eve.h index c1b91e4..145c4ba 100644 --- a/fw/fe310/eos/eve/eve.h +++ b/fw/fe310/eos/eve/eve.h @@ -75,4 +75,5 @@ uint8_t eve_gpio_get_dir(void); void eve_gpio_set_dir(uint8_t dir); void eve_brightness(uint8_t b); -void eve_lcd_absent(void);
\ No newline at end of file +void eve_lcd_absent(void); +void eve_copro_reset(void); |