Compare commits
2 Commits
8692b71fd8
...
9827a8f6be
Author | SHA1 | Date | |
---|---|---|---|
|
9827a8f6be | ||
|
57f7b1b48d |
Binary file not shown.
@ -1073,6 +1073,8 @@ 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
|
||||||
@ -1080,6 +1082,7 @@ 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
|
||||||
|
@ -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>true</KeepTimersRunning>
|
<KeepTimersRunning>false</KeepTimersRunning>
|
||||||
<OverrideVtor>false</OverrideVtor>
|
<OverrideVtor>false</OverrideVtor>
|
||||||
<CacheFlash>true</CacheFlash>
|
<CacheFlash>true</CacheFlash>
|
||||||
<ProgFlashFromRam>true</ProgFlashFromRam>
|
<ProgFlashFromRam>true</ProgFlashFromRam>
|
||||||
@ -43,7 +43,8 @@
|
|||||||
<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>UPDI</avrtoolinterface>
|
<avrtoolinterface>
|
||||||
|
</avrtoolinterface>
|
||||||
<com_atmel_avrdbg_tool_snap>
|
<com_atmel_avrdbg_tool_snap>
|
||||||
<ToolOptions>
|
<ToolOptions>
|
||||||
<InterfaceProperties>
|
<InterfaceProperties>
|
||||||
@ -134,81 +135,81 @@
|
|||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<ToolchainSettings>
|
<ToolchainSettings>
|
||||||
<AvrGccCpp>
|
<AvrGccCpp>
|
||||||
<avrgcc.common.Device>-mmcu=attiny402 -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.10.348\gcc\dev\attiny402"</avrgcc.common.Device>
|
<avrgcc.common.Device>-mmcu=attiny402 -B "%24(PackRepoDir)\atmel\ATtiny_DFP\1.10.348\gcc\dev\attiny402"</avrgcc.common.Device>
|
||||||
<avrgcc.common.optimization.RelaxBranches>True</avrgcc.common.optimization.RelaxBranches>
|
<avrgcc.common.optimization.RelaxBranches>True</avrgcc.common.optimization.RelaxBranches>
|
||||||
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
|
<avrgcc.common.outputfiles.hex>True</avrgcc.common.outputfiles.hex>
|
||||||
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
|
<avrgcc.common.outputfiles.lss>True</avrgcc.common.outputfiles.lss>
|
||||||
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
|
<avrgcc.common.outputfiles.eep>True</avrgcc.common.outputfiles.eep>
|
||||||
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
|
<avrgcc.common.outputfiles.srec>True</avrgcc.common.outputfiles.srec>
|
||||||
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
|
<avrgcc.common.outputfiles.usersignatures>False</avrgcc.common.outputfiles.usersignatures>
|
||||||
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
|
<avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcc.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||||
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
|
<avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcc.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||||
<avrgcc.compiler.symbols.DefSymbols>
|
<avrgcc.compiler.symbols.DefSymbols>
|
||||||
<ListValues>
|
<ListValues>
|
||||||
<Value>DEBUG</Value>
|
<Value>DEBUG</Value>
|
||||||
<Value>ARDUINO=108019</Value>
|
<Value>ARDUINO=108019</Value>
|
||||||
</ListValues>
|
</ListValues>
|
||||||
</avrgcc.compiler.symbols.DefSymbols>
|
</avrgcc.compiler.symbols.DefSymbols>
|
||||||
<avrgcc.compiler.directories.IncludePaths>
|
<avrgcc.compiler.directories.IncludePaths>
|
||||||
<ListValues>
|
<ListValues>
|
||||||
<Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.10.348\include\</Value>
|
<Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.10.348\include\</Value>
|
||||||
<Value>../../Arduino/megatinycore</Value>
|
<Value>../../Arduino/megatinycore</Value>
|
||||||
<Value>../../Arduino/variants/txy2</Value>
|
<Value>../../Arduino/variants/txy2</Value>
|
||||||
</ListValues>
|
</ListValues>
|
||||||
</avrgcc.compiler.directories.IncludePaths>
|
</avrgcc.compiler.directories.IncludePaths>
|
||||||
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
|
<avrgcc.compiler.optimization.level>Optimize for size (-Os)</avrgcc.compiler.optimization.level>
|
||||||
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
|
<avrgcc.compiler.optimization.PackStructureMembers>True</avrgcc.compiler.optimization.PackStructureMembers>
|
||||||
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
<avrgcc.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcc.compiler.optimization.AllocateBytesNeededForEnum>
|
||||||
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
|
<avrgcc.compiler.optimization.DebugLevel>Default (-g2)</avrgcc.compiler.optimization.DebugLevel>
|
||||||
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
<avrgcc.compiler.warnings.AllWarnings>True</avrgcc.compiler.warnings.AllWarnings>
|
||||||
<avrgcc.compiler.miscellaneous.OtherFlags>-std=gnu11</avrgcc.compiler.miscellaneous.OtherFlags>
|
<avrgcc.compiler.miscellaneous.OtherFlags>-std=gnu11</avrgcc.compiler.miscellaneous.OtherFlags>
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>
|
<avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultCharTypeUnsigned>
|
||||||
<avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>
|
<avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>True</avrgcccpp.compiler.general.ChangeDefaultBitFieldUnsigned>
|
||||||
<avrgcccpp.compiler.symbols.DefSymbols>
|
<avrgcccpp.compiler.symbols.DefSymbols>
|
||||||
<ListValues>
|
<ListValues>
|
||||||
<Value>DEBUG</Value>
|
<Value>DEBUG</Value>
|
||||||
<Value>ARDUINO=108019</Value>
|
<Value>ARDUINO=108019</Value>
|
||||||
<Value>ARDUINO_AVR_ATtinyxy4</Value>
|
<Value>ARDUINO_AVR_ATtinyxy4</Value>
|
||||||
<Value>ARDUINO_attinyxy4</Value>
|
<Value>ARDUINO_attinyxy4</Value>
|
||||||
<Value>F_CPU=8000000UL</Value>
|
<Value>F_CPU=8000000UL</Value>
|
||||||
<Value>MEGATINYCORE="2.6.10"</Value>
|
<Value>MEGATINYCORE="2.6.10"</Value>
|
||||||
<Value>MEGATINYCORE_MAJOR=2UL</Value>
|
<Value>MEGATINYCORE_MAJOR=2UL</Value>
|
||||||
<Value>MEGATINYCORE_MINOR=6UL</Value>
|
<Value>MEGATINYCORE_MINOR=6UL</Value>
|
||||||
<Value>MEGATINYCORE_PATCH=10UL</Value>
|
<Value>MEGATINYCORE_PATCH=10UL</Value>
|
||||||
<Value>MEGATINYCORE_RELEASED=1</Value>
|
<Value>MEGATINYCORE_RELEASED=1</Value>
|
||||||
<Value>MILLIS_USE_TIMERA0</Value>
|
<Value>MILLIS_USE_TIMERA0</Value>
|
||||||
<Value>CLOCK_SOURCE=0</Value>
|
<Value>CLOCK_SOURCE=0</Value>
|
||||||
<Value>TWI_MORS</Value>
|
<Value>TWI_MORS</Value>
|
||||||
</ListValues>
|
</ListValues>
|
||||||
</avrgcccpp.compiler.symbols.DefSymbols>
|
</avrgcccpp.compiler.symbols.DefSymbols>
|
||||||
<avrgcccpp.compiler.directories.IncludePaths>
|
<avrgcccpp.compiler.directories.IncludePaths>
|
||||||
<ListValues>
|
<ListValues>
|
||||||
<Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.10.348\include\</Value>
|
<Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.10.348\include\</Value>
|
||||||
<Value>../../Arduino/megatinycore</Value>
|
<Value>../../Arduino/megatinycore</Value>
|
||||||
<Value>../../Arduino/variants/txy2</Value>
|
<Value>../../Arduino/variants/txy2</Value>
|
||||||
<Value>../../Arduino/arduino_libraries/tinyNeoPixel_static</Value>
|
<Value>../../Arduino/arduino_libraries/tinyNeoPixel_static</Value>
|
||||||
</ListValues>
|
</ListValues>
|
||||||
</avrgcccpp.compiler.directories.IncludePaths>
|
</avrgcccpp.compiler.directories.IncludePaths>
|
||||||
<avrgcccpp.compiler.optimization.level>Optimize for size (-Os)</avrgcccpp.compiler.optimization.level>
|
<avrgcccpp.compiler.optimization.level>Optimize for size (-Os)</avrgcccpp.compiler.optimization.level>
|
||||||
<avrgcccpp.compiler.optimization.OtherFlags>-fno-threadsafe-statics</avrgcccpp.compiler.optimization.OtherFlags>
|
<avrgcccpp.compiler.optimization.OtherFlags>-fno-threadsafe-statics</avrgcccpp.compiler.optimization.OtherFlags>
|
||||||
<avrgcccpp.compiler.optimization.PackStructureMembers>True</avrgcccpp.compiler.optimization.PackStructureMembers>
|
<avrgcccpp.compiler.optimization.PackStructureMembers>True</avrgcccpp.compiler.optimization.PackStructureMembers>
|
||||||
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
|
<avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
|
||||||
<avrgcccpp.compiler.optimization.DebugLevel>Default (-g2)</avrgcccpp.compiler.optimization.DebugLevel>
|
<avrgcccpp.compiler.optimization.DebugLevel>Default (-g2)</avrgcccpp.compiler.optimization.DebugLevel>
|
||||||
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
|
<avrgcccpp.compiler.warnings.AllWarnings>True</avrgcccpp.compiler.warnings.AllWarnings>
|
||||||
<avrgcccpp.compiler.miscellaneous.OtherFlags>-std=gnu++17</avrgcccpp.compiler.miscellaneous.OtherFlags>
|
<avrgcccpp.compiler.miscellaneous.OtherFlags>-std=gnu++17</avrgcccpp.compiler.miscellaneous.OtherFlags>
|
||||||
<avrgcccpp.linker.libraries.Libraries>
|
<avrgcccpp.linker.libraries.Libraries>
|
||||||
<ListValues>
|
<ListValues>
|
||||||
<Value>libm</Value>
|
<Value>libm</Value>
|
||||||
</ListValues>
|
</ListValues>
|
||||||
</avrgcccpp.linker.libraries.Libraries>
|
</avrgcccpp.linker.libraries.Libraries>
|
||||||
<avrgcccpp.linker.miscellaneous.LinkerFlags>-Os -fuse-linker-plugin</avrgcccpp.linker.miscellaneous.LinkerFlags>
|
<avrgcccpp.linker.miscellaneous.LinkerFlags>-Os -fuse-linker-plugin</avrgcccpp.linker.miscellaneous.LinkerFlags>
|
||||||
<avrgcccpp.assembler.general.IncludePaths>
|
<avrgcccpp.assembler.general.IncludePaths>
|
||||||
<ListValues>
|
<ListValues>
|
||||||
<Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.10.348\include\</Value>
|
<Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.10.348\include\</Value>
|
||||||
</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>
|
||||||
|
@ -34,15 +34,13 @@ 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 (prescale) / 1 (CLK_PER) = 4MHz
|
// so 8MHz / 2 (timer prescale) / 2 (CLK_PER) = 2MHz
|
||||||
// this will allow a full cycle time of ~61Hz.
|
// this will allow a cycle time with 33333 counts to be 60Hz.
|
||||||
|
|
||||||
_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 = 0xffff; // count to full
|
TCB0.CCMP = 33333 - 1; // count to full
|
||||||
TCB0.CNT = 0;
|
TCB0.CNT = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user