Blog 2018/8/4
<- previous | index | next ->
| # Makefile for ATmegaBOOT | |
| # E.Lins, 18.7.2005 | |
| # $Id$ | |
| # | |
| # Instructions | |
| # | |
| # To make bootloader .hex file: | |
| # make diecimila | |
| # make lilypad | |
| # make ng |
| #include "AnyWire.h" | |
| #include <Arduino.h> | |
| #include <Wire.h> | |
| #include "SoftwareWire.h" | |
| // | |
| // Constructors | |
| // | |
| AnyWire::AnyWire() { | |
| _softwareWire = NULL; |
Blog 2018/8/4
<- previous | index | next ->
| import UIKit | |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
| let window = UIWindow(frame: UIScreen.main.bounds) |
| test: parse | |
| ./parse | |
| parse: parse.c | |
| gcc -Wall -Werror -o parse parse.c | |
| clean: | |
| rm -f parse | |
| .PHONY: clean |
| All tests passed. | |
| benchmarking... | |
| naive malloc: elapsed: 59.271ms, rate: 16,871,657m/s, n: 1,000,000 (1) | |
| pp_malloc: elapsed: 28.880ms, rate: 34,626,039m/s, n: 1,000,000 |
| // a linked list of pending key events (press or release) which we haven't processed yet. | |
| typedef struct _pending_key_t { | |
| uint16_t keycode; | |
| keyrecord_t record; | |
| struct _pending_key_t *next; | |
| } pending_key_t; | |
| // worst case is 10 down strokes and 1 up stroke before we can start disambiguating. | |
| #define RINGSIZE 11 |
| /* key matrix position */ | |
| typedef struct { | |
| uint8_t col; | |
| uint8_t row; | |
| } keypos_t; | |
| /* key event */ | |
| typedef struct { | |
| keypos_t key; | |
| bool pressed; |
| #!/usr/bin/env python | |
| import sys | |
| import serial | |
| import time | |
| import os | |
| if __name__ == "__main__": | |
| if len(sys.argv) < 2: |
Blog 2019/1/25
<- previous | index | next ->
Browsing solutions is a great way to quickly familiarize yourself with a new language!