1
0
Fork 0
forked from len0rd/rockbox

set/clear port bits with atomic instructions instead of read-modify-write, saves time+space, allows port usage in ISR

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4022 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jörg Hohensohn 2003-11-06 01:34:50 +00:00
parent 9e95757928
commit 75bab49a54
8 changed files with 88 additions and 67 deletions

View file

@ -23,6 +23,7 @@
#include "debug.h"
#include "mas.h"
#include "kernel.h"
#include "system.h"
extern bool old_recorder;
@ -268,21 +269,21 @@ static int mas_devread(unsigned long *dest, int len)
#ifdef HAVE_MAS3587F
void mas_reset(void)
{
PAIOR |= 0x100;
__set_bit_constant(8-8, &PAIORH);
if(old_recorder)
{
/* Older recorder models don't invert the POR signal */
PADR |= 0x100;
__set_bit_constant(8-8, &PADRH);
sleep(HZ/100);
PADR &= ~0x100;
__clear_bit_constant(8-8, &PADRH);
sleep(HZ/5);
}
else
{
PADR &= ~0x100;
__clear_bit_constant(8-8, &PADRH);
sleep(HZ/100);
PADR |= 0x100;
__set_bit_constant(8-8, &PADRH);
sleep(HZ/5);
}
}