summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/eve.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/eve/eve.c')
-rw-r--r--fw/fe310/eos/eve/eve.c26
1 files changed, 15 insertions, 11 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);
+}