summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2022-08-14 01:29:45 +0200
committerUros Majstorovic <majstor@majstor.org>2022-08-14 01:29:45 +0200
commita019386dd1ebae0f0b2c01bf0218baa3e6bfd692 (patch)
tree2da092f2fc4f45cd3ad0df547b7ccc4468aaad3d
parent3f335d1340be02f9266cf00927d455a62ad0e619 (diff)
added copro reset f
-rw-r--r--fw/fe310/eos/eve/eve.c26
-rw-r--r--fw/fe310/eos/eve/eve.h3
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);