test
This commit is contained in:
parent
a81f124774
commit
0b260c78ab
|
@ -1,3 +1,4 @@
|
|||
|
||||
#include "addresses.h"
|
||||
#include "Sound4Calc.h"
|
||||
|
||||
|
@ -27,7 +28,7 @@ const char* bincod = "111011001000100011101" ;
|
|||
|
||||
unsigned char range = 0;
|
||||
|
||||
void lect440()
|
||||
void lect()
|
||||
{
|
||||
// range = (range < 20 ? range +1 : 0);
|
||||
|
||||
|
@ -56,11 +57,11 @@ int main(void)
|
|||
//unsigned int i=0;
|
||||
|
||||
setup();
|
||||
|
||||
|
||||
while(1)
|
||||
{
|
||||
dclear();
|
||||
|
||||
|
||||
// dprint(1, 1, "%d", freq);
|
||||
// PrintMini(1, 1, itoa(freq, str, 10), 0);
|
||||
// dprint(1, 10, "%d", !isSH3());
|
||||
|
@ -81,13 +82,13 @@ int main(void)
|
|||
case KEY_DOWN : freq-=10; break;
|
||||
|
||||
case KEY_EXE :
|
||||
timer_start(TIMER_USER, 8800, Clock_Hz, lect440, 0);
|
||||
timer_start(TIMER_USER, 8800, Clock_Hz, lect, 0);
|
||||
|
||||
break;
|
||||
case KEY_EXIT :
|
||||
timer_stop(TIMER_USER);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1; // this point is never reached
|
||||
}
|
||||
|
@ -102,7 +103,7 @@ void setup()
|
|||
|
||||
// SCIF2 clock on (STBCR3.MSTP31)
|
||||
*(volatile unsigned char*)SH7337_STBCR3 &= ~0x02;
|
||||
// switch off SCSMR_2.TE and SCSMR_2.RE
|
||||
// switch off SCSMR_2.TE and SCSMR_2.RE
|
||||
*(volatile unsigned short*)SH7337_SCSCR2 &= ~0x0030;
|
||||
// SCIF2 clock off (STBCR3.MSTP31)
|
||||
*(volatile unsigned char*)SH7337_STBCR3 |= 0x02;
|
||||
|
@ -110,17 +111,17 @@ void setup()
|
|||
*(volatile unsigned short*)SH7337_PGCR = ( *(volatile unsigned short*)SH7337_PGCR & ~0x3000 ) | 0x1000;
|
||||
// set bit 5 and 6 of port G
|
||||
*(volatile unsigned char*)SH7337_PGDR |= 0x60;
|
||||
// set port SC bit 0 to output
|
||||
// set port SC bit 0 to output
|
||||
*(volatile unsigned short*)SH7337_SCPCR = ( *(volatile unsigned short*)SH7337_SCPCR & ~0x0003 ) | 0x0001;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
// initialisation of pin
|
||||
*(volatile unsigned char*)SH7305_PJDR |= 0x04;
|
||||
|
||||
// SCIF2 clock on (MSTPCR0.MSTP007)
|
||||
// SCIF2 clock on (MSTPCR0.MSTP007)
|
||||
*(volatile unsigned int*)SH7305_MSTPCR0 &= ~0x00000080;
|
||||
// switch off SCSMR_2.TE and SCSMR_2.RE
|
||||
// switch off SCSMR_2.TE and SCSMR_2.RE
|
||||
*(volatile unsigned short*)SH7305_SCSCR &= ~0x0030;
|
||||
// SCIF2 clock off (MSTPCR0.MSTP007)
|
||||
*(volatile unsigned int*)SH7305_MSTPCR0 |= 0x00000080;
|
||||
|
@ -130,14 +131,14 @@ void setup()
|
|||
// set bit 4 and 5 of port U
|
||||
*(volatile unsigned char*)SH7305_PUDR |= 0x0C;
|
||||
|
||||
// set port J bit 2 to output mode
|
||||
// set port J bit 2 to output mode
|
||||
*(volatile unsigned short*)SH7305_PJCR = ( *(volatile unsigned short*)SH7305_PJCR & ~0x0030 ) | 0x0010;
|
||||
// set port J bit 3 to output mode
|
||||
*(volatile unsigned short*)SH7305_PJCR = ( *(volatile unsigned short*)SH7305_PJCR & ~0x00C0 ) | 0x0040;
|
||||
}
|
||||
/*
|
||||
// set port J bit 2 to output
|
||||
// set port J bit 2 to output
|
||||
*(unsigned short*)0xA4050110 = ( *(unsigned short*)0xA4050110 & ~0x0030 ) | 0x0010;
|
||||
// set port J bit 3 to input
|
||||
// set port J bit 3 to input
|
||||
*(unsigned short*)0xA4050110 = ( *(unsigned short*)0xA4050110 & ~0x00C0 ) | 0x0080;*/
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue