diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-06-26 12:39:49 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-06-26 12:39:49 +0000 |
| commit | d1d63960b9b79fcac318ddd0571f12594ee697b1 (patch) | |
| tree | 7dc7865619ce2ab6f3bd33619f2508b3ca321638 | |
| parent | 1a5032e7edfd7e8feaa3c3696f2de561f5d08c91 (diff) | |
| download | rockbox-d1d63960b9b79fcac318ddd0571f12594ee697b1.zip rockbox-d1d63960b9b79fcac318ddd0571f12594ee697b1.tar.gz rockbox-d1d63960b9b79fcac318ddd0571f12594ee697b1.tar.bz2 rockbox-d1d63960b9b79fcac318ddd0571f12594ee697b1.tar.xz | |
Added mas_reset()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1196 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/drivers/mas.c | 27 | ||||
| -rw-r--r-- | firmware/drivers/mas.h | 1 |
2 files changed, 28 insertions, 0 deletions
diff --git a/firmware/drivers/mas.c b/firmware/drivers/mas.c index c4daed9..f13f8ae 100644 --- a/firmware/drivers/mas.c +++ b/firmware/drivers/mas.c @@ -16,9 +16,14 @@ * KIND, either express or implied. * ****************************************************************************/ +#include "stdbool.h" +#include "sh7034.h" #include "i2c.h" #include "debug.h" #include "mas.h" +#include "kernel.h" + +extern bool old_recorder; static int mas_devread(unsigned long *dest, int len); @@ -260,6 +265,28 @@ static int mas_devread(unsigned long *dest, int len) } #ifdef ARCHOS_RECORDER + +void mas_reset(void) +{ + PAIOR |= 0x100; + + if(old_recorder) + { + /* Older recorder models don't invert the POR signal */ + PADR |= 0x100; + sleep(HZ/100); + PADR &= ~0x100; + sleep(HZ/5); + } + else + { + PADR &= ~0x100; + sleep(HZ/100); + PADR |= 0x100; + sleep(HZ/5); + } +} + int mas_direct_config_read(unsigned char reg) { int ret = 0; diff --git a/firmware/drivers/mas.h b/firmware/drivers/mas.h index 116863f..32314fc 100644 --- a/firmware/drivers/mas.h +++ b/firmware/drivers/mas.h @@ -90,6 +90,7 @@ int mas_readmem(int bank, int addr, unsigned long* dest, int len); int mas_writemem(int bank, int addr, unsigned long* src, int len); int mas_readreg(int reg); int mas_writereg(int reg, unsigned int val); +void mas_reset(void); int mas_direct_config_read(unsigned char reg); int mas_direct_config_write(unsigned char reg, unsigned int val); int mas_codec_writereg(int reg, unsigned int val); |