Fix several bugs

This commit is contained in:
Brooke 2025-04-28 00:00:41 -04:00
parent 39151185fb
commit 8692b71fd8
4 changed files with 24 additions and 5 deletions

View File

@ -101,7 +101,7 @@ void tinyNeoPixel::show(uint16_t leds) {
// subsequent round of data until the latch time has elapsed. This
// allows the mainline code to start generating the next frame of data
// rather than stalling for the latch.
while (!canShow());
// while (!canShow());
// endTime is a private member (rather than global var) so that multiple
// instances on different pins can be quickly issued in succession (each
// instance doesn't delay the next).

View File

@ -40,6 +40,22 @@
</dependencies>
</framework-data>
</AsfFrameworkConfig>
<avrtool>com.atmel.avrdbg.tool.snap</avrtool>
<avrtoolserialnumber>021038102RYN</avrtoolserialnumber>
<avrdeviceexpectedsignature>0x1E9227</avrdeviceexpectedsignature>
<avrtoolinterface>UPDI</avrtoolinterface>
<com_atmel_avrdbg_tool_snap>
<ToolOptions>
<InterfaceProperties>
<UpdiClock>750000</UpdiClock>
</InterfaceProperties>
<InterfaceName>UPDI</InterfaceName>
</ToolOptions>
<ToolType>com.atmel.avrdbg.tool.snap</ToolType>
<ToolNumber>021038102RYN</ToolNumber>
<ToolName>MPLAB® Snap</ToolName>
</com_atmel_avrdbg_tool_snap>
<avrtoolinterfaceclock>750000</avrtoolinterfaceclock>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<ToolchainSettings>
@ -174,7 +190,7 @@
</ListValues>
</avrgcccpp.compiler.directories.IncludePaths>
<avrgcccpp.compiler.optimization.level>Optimize for size (-Os)</avrgcccpp.compiler.optimization.level>
<avrgcccpp.compiler.optimization.OtherFlags>-fno-threadsafe-statics -flto</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.AllocateBytesNeededForEnum>True</avrgcccpp.compiler.optimization.AllocateBytesNeededForEnum>
<avrgcccpp.compiler.optimization.DebugLevel>Default (-g2)</avrgcccpp.compiler.optimization.DebugLevel>
@ -185,7 +201,7 @@
<Value>libm</Value>
</ListValues>
</avrgcccpp.linker.libraries.Libraries>
<avrgcccpp.linker.miscellaneous.LinkerFlags>-Os -fuse-linker-plugin -flto</avrgcccpp.linker.miscellaneous.LinkerFlags>
<avrgcccpp.linker.miscellaneous.LinkerFlags>-Os -fuse-linker-plugin</avrgcccpp.linker.miscellaneous.LinkerFlags>
<avrgcccpp.assembler.general.IncludePaths>
<ListValues>
<Value>%24(PackRepoDir)\atmel\ATtiny_DFP\1.10.348\include\</Value>

View File

@ -33,7 +33,7 @@ ISR(PORTA_PORT_vect)
delay(5);
// was our pin changed?
if (intflags & PIN3_bm) {
if (intflags & PIN2_bm) {
// start or re-start running a program
run_rgbprog = 1; // run a new program
}

View File

@ -123,7 +123,10 @@ void loop() {
switch (run_rgbprog) {
case RGB_INIT: { // just started running a program
digitalWrite(PIN_LED_PWRENA, HIGH); // enable LED power supply,
delay(20); // wait a moment for LEDs to stabilize,
delay(15); // wait a moment for LEDs to stabilize,
/*for (uint16_t i = 0; i < (8000000UL / 4 / 1000) * 20; i++) {
asm("nop");
}*/
rgbprog_idx++; // select the next program in sequence,
if (rgbprog_idx >= PROG_COUNT) {