mirror of
https://github.com/cnlohr/lolra.git
synced 2026-06-17 00:09:31 +00:00
Wild design!! Broad strokes around 900MHz
This commit is contained in:
@@ -400,7 +400,7 @@ int main()
|
|||||||
TIM1->CHCTLR1 = TIM_OC1M_2 | TIM_OC1M_1;
|
TIM1->CHCTLR1 = TIM_OC1M_2 | TIM_OC1M_1;
|
||||||
|
|
||||||
// Set the Capture Compare Register value to 50% initially
|
// Set the Capture Compare Register value to 50% initially
|
||||||
TIM1->CH3CVR = 7;
|
TIM1->CH3CVR = 3;
|
||||||
TIM1->CH1CVR = 0; // This triggers DMA.
|
TIM1->CH1CVR = 0; // This triggers DMA.
|
||||||
|
|
||||||
// Enable TIM1 outputs
|
// Enable TIM1 outputs
|
||||||
@@ -451,32 +451,33 @@ int main()
|
|||||||
uint32_t targ = 2000;
|
uint32_t targ = 2000;
|
||||||
|
|
||||||
int run_f = 0;
|
int run_f = 0;
|
||||||
|
|
||||||
|
const uint32_t tablef[] = {
|
||||||
|
0x0a0a0a0a,
|
||||||
|
0x0a0a0a0b,
|
||||||
|
0x0a0b0a0b,
|
||||||
|
0x0b0b0b0a,
|
||||||
|
0x0b0b0b0b,
|
||||||
|
0x0b0b0b0c,
|
||||||
|
0x0b0c0b0c,
|
||||||
|
0x0c0c0c0b,
|
||||||
|
0x0c0c0c0c, };
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
//XXX GET CREATIVE HOW TO DITHER
|
//XXX GET CREATIVE HOW TO DITHER
|
||||||
uint32_t cp = (SysTick->CNT>>16)&0x7ff;
|
uint32_t cp = (SysTick->CNT>>16)&0x1fff;
|
||||||
int targ_f = cp+37*4*4; //(frameno & 511)*9 + 1700;
|
int shift = cp; //(frameno & 511)*9 + 1700;
|
||||||
|
int targ_f = 1024;
|
||||||
uint32_t * tail = 0xfffffffc & (uintptr_t)(((uint8_t*)end) - DMA1_Channel2->CNTR);
|
uint32_t * tail = 0xfffffffc & (uintptr_t)(((uint8_t*)end) - DMA1_Channel2->CNTR);
|
||||||
|
|
||||||
if( tail == end ) tail--;
|
if( tail == end ) tail--;
|
||||||
|
|
||||||
while( here != tail )
|
while( here != tail )
|
||||||
{
|
{
|
||||||
uint32_t setf = 0x0a0a0a09;
|
*(here++) = tablef[run_f>>10];
|
||||||
if( run_f > targ_f )
|
run_f &= 1023;
|
||||||
{
|
run_f += shift;
|
||||||
setf = 0x0a0a0a0a;
|
|
||||||
run_f += 37*4*4;
|
|
||||||
run_f -= targ_f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
run_f += 36*4*4;
|
|
||||||
}
|
|
||||||
|
|
||||||
*here = setf;
|
|
||||||
|
|
||||||
here++;
|
|
||||||
if( here == end )
|
if( here == end )
|
||||||
here = start;
|
here = start;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user