This file contains hidden or 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
/* isc license probably */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <time.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <poll.h> |
This file contains hidden or 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
#!/usr/bin/env bash | |
# richard campbell | |
# isc license | |
# | |
# assumptions/caveats: | |
# - this script is run by bash 3.2+, produces a Makefile suitable for gnu make 3.81+ | |
# - targets to build have a main function in a .c file of the same name | |
# - each module depended upon is in the same directory | |
# - each module depended upon consists of one .c and one .h file | |
# - if you need to link in external libraries, you still need to manually provide those to make via LDLIBS |
This file contains hidden or 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 "lora_minimalist.h" | |
#include "lora_minimalist_hal.h" | |
unsigned char lora_minimalist_recv_buffer[242]; | |
volatile size_t lora_minimalist_recv_buffer_filled; | |
static struct spi_settings * spi_settings; | |
static volatile enum { STANDBY, TRANSMITTING, RECEIVING } mode, mode_after_tx; | |
static void spi_write_register(uint8_t reg, uint8_t val) { |
This file contains hidden or 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
#!/bin/bash | |
# Get around the "stty not persistent" issue on macOS (works fine on linux too) | |
# Usage: ./catty.sh /dev/cu.SLAB_USBtoUART 115200 | |
exec 3<>$1 | |
stty speed $2 <&3 >/dev/null | |
exec cat <&3 |
This file contains hidden or 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 "one_interval_has_elapsed.h" | |
#if defined(__AVR__) | |
#include <avr/power.h> | |
#if 1 | |
/* avr using timer2 and SLEEP_MODE_PWR_SAVE, uses 400-800 uA at 3.3V depending on clock speed */ | |
#include <avr/io.h> |
This file contains hidden or 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
/* allows c code to printf() within arduino sketches, given arm newlib or avr-libc */ | |
#ifdef __arm__ | |
/* TODO: proper check for newlib */ | |
#ifdef USE_TINYUSB | |
#include <Adafruit_TinyUSB.h> | |
#endif | |
#include <Arduino.h> | |
extern "C" |
This file contains hidden or 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
see https://github.com/rlcamp/coroutine |
NewerOlder