This commit is contained in:
flo66 2017-01-08 12:13:56 +01:00
parent c940d5ad9d
commit 01b7c62b8b
1 changed files with 6 additions and 36 deletions

View File

@ -26,7 +26,7 @@ int main(void)
{
unsigned int key=0;
int sleep = 440;
int freq = 440;
//unsigned int i=0;
setup();
@ -35,9 +35,9 @@ int main(void)
{
dclear();
dprint(1, 1, "%d", sleep);
dprint(1, 1, "%d", freq);
// PrintMini(1, 1, itoa(sleep, str, 10), 0);
// PrintMini(1, 1, itoa(freq, str, 10), 0);
dprint(1, 10, "%d", !isSH3());
//PrintMini(1, 10, itoa(is_SH4, str, 10), 0);
@ -47,10 +47,10 @@ int main(void)
switch(key)
{
case KEY_RIGHT : sleep+=5; break;
case KEY_LEFT : sleep-=5; break;
case KEY_RIGHT : freq+=10; break;
case KEY_LEFT : freq-=10; break;
case KEY_EXE :
timer_start(TIMER_USER, sleep, Clock_Hz, switchStatePin, 2*sleep);
timer_start(TIMER_USER, 2*freq, Clock_Hz, switchStatePin, 4*freq);
break;
case KEY_EXIT :
timer_stop(TIMER_USER);
@ -108,34 +108,4 @@ void setup()
*(unsigned short*)0xA4050110 = ( *(unsigned short*)0xA4050110 & ~0x0030 ) | 0x0010;
// set port J bit 3 to input
*(unsigned short*)0xA4050110 = ( *(unsigned short*)0xA4050110 & ~0x00C0 ) | 0x0080;*/
}
void SetPin()
{
if(isSH3())
{
*(volatile unsigned char*)SH7337_SCPDR |= 0x01;
}
else
{
*(volatile unsigned char*)SH7305_PJDR |= 0x04;
//*(volatile unsigned char*)SH7305_PJDR &= ~0x08;
//set pin to 0x4B
}
}
void ResetPin()
{
if(isSH3())
{
*(volatile unsigned char*)SH7337_SCPDR &= ~0x01;
}
else
{
*(volatile unsigned char*)SH7305_PJDR &= ~0x04;
//*(volatile unsigned char*)SH7305_PJDR |= 0x08;
// set the pin to 0x47
}
}