Skip to content
Snippets Groups Projects
Commit d408ebe4 authored by Eric Brombaugh's avatar Eric Brombaugh
Browse files

Get synced

Merge branch 'master' of github.com:emeb/ch32v003fun
parents 3236aaf9 279fb15d
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,6 @@ int main()
GPIOD->BSHR = (1<<16) | (1<<(16+4)); // Turn off GPIODs
GPIOC->BSHR = (1<<16);
printf( "-%lu\n", count++ );
count++;
//_write( 0, "xxxxxxx", 7 );
}
}
......
......@@ -25,8 +25,8 @@ uint32_t WS2812BLEDCallback( int ledno )
uint8_t index = (phases[ledno])>>8;
uint8_t rsbase = sintable[index];
uint8_t rs = rsbase>>3;
uint32_t fire = (huetable[(rs+190)&0xff]<<16) | (huetable[(rs+30)&0xff]) | (huetable[(rs+0)]<<8);
uint32_t ice = 0xff0000 | ((rsbase)<<8) | ((rsbase));
uint32_t fire = (huetable[(rs+190)&0xff]<<16) | (huetable[(rs+30)&0xff]) | ((huetable[(rs+0)]>>1)<<8);
uint32_t ice = 0x7f0000 | ((rsbase>>1)<<8) | ((rsbase>>1));
// Because this chip doesn't natively support multiplies, we are going to avoid tweening of 1..254.
return TweenHexColors( fire, ice, ((tween + ledno)>0)?255:0 ); // Where "tween" is a value from 0 ... 255
......
......@@ -193,9 +193,10 @@ printf( " 5: %d\n", bOn );
return 0;
}
static int LEUnbrick( void * dev )
static int LEUnbrick( void * d )
{
printf( "Sending unbrick\n" );
libusb_device_handle * dev = ((struct LinkEProgrammerStruct*)d)->devh;
wch_link_command( (libusb_device_handle *)dev, "\x81\x0d\x01\x0f\x09", 5, 0, 0, 0 );
printf( "Done unbrick\n" );
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment