Compare commits

..

No commits in common. "9827a8f6bea02aec96ff5db253f6eff2894747cd" and "8692b71fd8efe7339e90e22cf67df156934d66e0" have entirely different histories.

4 changed files with 83 additions and 85 deletions

View File

@ -1073,8 +1073,6 @@ void tinyNeoPixel::show(uint16_t leds) {
interrupts(); interrupts();
/*
#if (!defined(MILLIS_USE_TIMERNONE) && !defined(MILLIS_USE_TIMERRTC) && !defined(MILLIS_USE_TIMERRTC_XTAL) && !defined(MILLIS_USE_TIMERRTC_XOSC)) #if (!defined(MILLIS_USE_TIMERNONE) && !defined(MILLIS_USE_TIMERRTC) && !defined(MILLIS_USE_TIMERRTC_XTAL) && !defined(MILLIS_USE_TIMERRTC_XOSC))
endTime = micros(); endTime = micros();
// Save EOD time for latch on next call // Save EOD time for latch on next call
@ -1082,7 +1080,6 @@ void tinyNeoPixel::show(uint16_t leds) {
#else #else
#pragma message("micros() is not available because millis is disabled from the tools subemnu. It is your responsibility to ensure a sufficient time has passed between calls to show(). See documentation.") #pragma message("micros() is not available because millis is disabled from the tools subemnu. It is your responsibility to ensure a sufficient time has passed between calls to show(). See documentation.")
#endif #endif
*/
} }
// Set the output pin number // Set the output pin number

View File

@ -16,7 +16,7 @@
<Name>HSC_Wand</Name> <Name>HSC_Wand</Name>
<RootNamespace>HackSpaceCon_AS7</RootNamespace> <RootNamespace>HackSpaceCon_AS7</RootNamespace>
<ToolchainFlavour>Native</ToolchainFlavour> <ToolchainFlavour>Native</ToolchainFlavour>
<KeepTimersRunning>false</KeepTimersRunning> <KeepTimersRunning>true</KeepTimersRunning>
<OverrideVtor>false</OverrideVtor> <OverrideVtor>false</OverrideVtor>
<CacheFlash>true</CacheFlash> <CacheFlash>true</CacheFlash>
<ProgFlashFromRam>true</ProgFlashFromRam> <ProgFlashFromRam>true</ProgFlashFromRam>
@ -43,8 +43,7 @@
<avrtool>com.atmel.avrdbg.tool.snap</avrtool> <avrtool>com.atmel.avrdbg.tool.snap</avrtool>
<avrtoolserialnumber>021038102RYN</avrtoolserialnumber> <avrtoolserialnumber>021038102RYN</avrtoolserialnumber>
<avrdeviceexpectedsignature>0x1E9227</avrdeviceexpectedsignature> <avrdeviceexpectedsignature>0x1E9227</avrdeviceexpectedsignature>
<avrtoolinterface> <avrtoolinterface>UPDI</avrtoolinterface>
</avrtoolinterface>
<com_atmel_avrdbg_tool_snap> <com_atmel_avrdbg_tool_snap>
<ToolOptions> <ToolOptions>
<InterfaceProperties> <InterfaceProperties>
@ -209,7 +208,7 @@
</ListValues> </ListValues>
</avrgcccpp.assembler.general.IncludePaths> </avrgcccpp.assembler.general.IncludePaths>
<avrgcccpp.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcccpp.assembler.debugging.DebugLevel> <avrgcccpp.assembler.debugging.DebugLevel>Default (-Wa,-g)</avrgcccpp.assembler.debugging.DebugLevel>
</AvrGccCpp> </AvrGccCpp>
</ToolchainSettings> </ToolchainSettings>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -34,13 +34,15 @@ uint8_t rgbled[3 * RGB_COUNT];
void conf_rgb_timer() void conf_rgb_timer()
{ {
// this timer will run at half speed. // this timer will run at half speed.
// so 8MHz / 2 (timer prescale) / 2 (CLK_PER) = 2MHz // so 8MHz / 2 (prescale) / 1 (CLK_PER) = 4MHz
// this will allow a cycle time with 33333 counts to be 60Hz. // this will allow a full cycle time of ~61Hz.
_PROTECTED_WRITE(CLKCTRL_MCLKCTRLB, 0); // disable CLK_PER divider
disable_rgb_timer(); disable_rgb_timer();
TCB0.CTRLA = TCB_CLKSEL_CLKDIV2_gc; // prescale timer to run at half speed TCB0.CTRLA = TCB_CLKSEL_CLKDIV2_gc; // prescale timer to run at half speed
TCB0.CCMP = 33333 - 1; // count to full TCB0.CCMP = 0xffff; // count to full
TCB0.CNT = 0; TCB0.CNT = 0;
} }