This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Fridge Door Alarm for the ATTiny13[A] | |
* | |
* Functionality: | |
* | |
* Door opens, door open chime. | |
* After 60 seconds, door-open warning beep. | |
* If door still open, warning beeps every 30 seconds. | |
* After 5 minutes, continous alarm signal. | |
* Door closes, door close chime. | |
* If Silent Running pressed, no door chimes for ONE operation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ralph Doncaster 2020 public domain software | |
// generate lookup table for powers of sqrt(2) | |
#include <stdio.h> | |
#include <math.h> | |
int main() | |
{ | |
double sqrt2 = sqrt(2.0); | |
for (double d = 2; d <= 16; d += 1) { | |
printf( "1.414^%d = %lf\n", (int)d, pow(sqrt2, d) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ralph Doncaster 2020 public domain software | |
// calculate the 64-bit inverse of odd integers | |
#include <stdio.h> | |
#include <stdint.h> | |
#define END_RANGE 9999 | |
int main() | |
{ | |
uint64_t neg1 = (uint64_t) -1LL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo ./openocd -f ~/devel/dap/cmsis-dap.cfg | |
xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev (2020-10-13-17:27) | |
Licensed under GNU GPL v2 | |
For bug reports, read | |
http://openocd.org/doc/doxygen/bugs.html | |
Info : CMSIS-DAP: SWD Supported | |
Info : CMSIS-DAP: FW Version = 1.0.0 | |
Info : CMSIS-DAP: Interface Initialised (SWD) | |
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1 | |
Info : CMSIS-DAP: Interface ready |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
extern __flash const uint8_t digital_pin_to_bit_mask_PGM[]; | |
uint8_t read_array(uint8_t i) | |
{ | |
return digital_pin_to_bit_mask_PGM[i]; // bug: uses ld | |
// return *(digital_pin_to_bit_mask_PGM + i); // uses lpm | |
} |
OlderNewer