Fix several bugs
This commit is contained in:
		
							parent
							
								
									39151185fb
								
							
						
					
					
						commit
						8692b71fd8
					
				@ -101,7 +101,7 @@ void tinyNeoPixel::show(uint16_t leds) {
 | 
				
			|||||||
  // subsequent round of data until the latch time has elapsed.  This
 | 
					  // subsequent round of data until the latch time has elapsed.  This
 | 
				
			||||||
  // allows the mainline code to start generating the next frame of data
 | 
					  // allows the mainline code to start generating the next frame of data
 | 
				
			||||||
  // rather than stalling for the latch.
 | 
					  // rather than stalling for the latch.
 | 
				
			||||||
  while (!canShow());
 | 
					  // while (!canShow());
 | 
				
			||||||
  // endTime is a private member (rather than global var) so that multiple
 | 
					  // endTime is a private member (rather than global var) so that multiple
 | 
				
			||||||
  // instances on different pins can be quickly issued in succession (each
 | 
					  // instances on different pins can be quickly issued in succession (each
 | 
				
			||||||
  // instance doesn't delay the next).
 | 
					  // instance doesn't delay the next).
 | 
				
			||||||
 | 
				
			|||||||
@ -40,6 +40,22 @@
 | 
				
			|||||||
        </dependencies>
 | 
					        </dependencies>
 | 
				
			||||||
      </framework-data>
 | 
					      </framework-data>
 | 
				
			||||||
    </AsfFrameworkConfig>
 | 
					    </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>
 | 
				
			||||||
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
 | 
					  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
 | 
				
			||||||
    <ToolchainSettings>
 | 
					    <ToolchainSettings>
 | 
				
			||||||
@ -174,7 +190,7 @@
 | 
				
			|||||||
    </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 -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.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>
 | 
				
			||||||
@ -185,7 +201,7 @@
 | 
				
			|||||||
      <Value>libm</Value>
 | 
					      <Value>libm</Value>
 | 
				
			||||||
    </ListValues>
 | 
					    </ListValues>
 | 
				
			||||||
  </avrgcccpp.linker.libraries.Libraries>
 | 
					  </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>
 | 
					  <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>
 | 
				
			||||||
 | 
				
			|||||||
@ -33,7 +33,7 @@ ISR(PORTA_PORT_vect)
 | 
				
			|||||||
    delay(5);
 | 
					    delay(5);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// was our pin changed?
 | 
						// was our pin changed?
 | 
				
			||||||
    if (intflags & PIN3_bm) {
 | 
					    if (intflags & PIN2_bm) {
 | 
				
			||||||
        // start or re-start running a program
 | 
					        // start or re-start running a program
 | 
				
			||||||
        run_rgbprog = 1;        // run a new program
 | 
					        run_rgbprog = 1;        // run a new program
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -123,7 +123,10 @@ void loop() {
 | 
				
			|||||||
	switch (run_rgbprog) {
 | 
						switch (run_rgbprog) {
 | 
				
			||||||
		case RGB_INIT: {						// just started running a program
 | 
							case RGB_INIT: {						// just started running a program
 | 
				
			||||||
			digitalWrite(PIN_LED_PWRENA, HIGH);	// enable LED power supply,
 | 
								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,
 | 
								rgbprog_idx++;						// select the next program in sequence,
 | 
				
			||||||
			if (rgbprog_idx >= PROG_COUNT) {
 | 
								if (rgbprog_idx >= PROG_COUNT) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user