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
// vim: set ts=2 sw=2 expandtab list | |
/* | |
* File: nco.cpp | |
* Description: NCO c++ template and testdriver | |
* | |
* Author: rick kimball | |
* | |
* g++ -DDEBUG -Wall -Os -g nco.cpp -o nco | |
*/ |
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
// sketch_oct16a | |
// printll provides printing for int64_t uint64_t types using Streaming.. | |
// Rick Kimball | |
#include "Streaming.h" | |
char * _print_base(char *buf, uint64_t n, int base) { | |
char *str = &buf[(64+1) - 1]; // handle printing bits | |
*str = '\0'; // work from least significant digit to most |
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
# STM32F1/Makefile - provide a way to use a custom boards.txt | |
# | |
# | |
.phony: all checkout clean | |
all: boards.txt | |
checkout: | |
git checkout boards.txt | |
boards.txt: |
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 | |
# read the w1-temp values | |
# put each line1 and 2 into variables | |
# parse and see if it is ready | |
# if so read the raw value and round it to 2 decimals | |
read_sensor() | |
{ | |
SENSOR_FILE=$1 | |
local __celsius_raw=$2 |
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
/* | |
* 60Hz.c - generate a 60Hz PWM sine wave msp430frxxxx | |
* | |
* This code written for msp430-elf-gcc | |
* | |
* Note: make sure to compile with -ffixed-R6 -ffixed-R7. | |
*/ | |
#include <msp430.h> | |
#include <inttypes.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
#include "ringbuffer_e.h" | |
#include "streaming.h" | |
uint8_t buffer[32]; | |
ring_buffer message_buffer = { buffer, 0, 0, sizeof(buffer) }; | |
void queue_message(const char *str) { | |
while (*str) { | |
GPIOC_BASE->BRR = (1 << 13); // time function using gpio toggle |
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 "libmaple/ring_buffer.h" | |
#include "streaming.h" | |
uint8_t buffer[32]; | |
ring_buffer message_buffer = { buffer, 0, 0, 32 - 1 }; | |
void queue_message(const char *str) { | |
while (*str) { | |
GPIOC_BASE->BRR = (1 << 13); // time function using gpio toggle |
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
/* | |
ringbuffer.h - fabooh version of the ringbuffer_t c++ template | |
Desc: A c++ template class implementing a lock free fixed sized ringbuffer | |
with arbitrary types. The push and pop methods implement adding and | |
removing items. The size and capacity methods return the unread | |
and max number of items in the buffer. | |
This version has been optimized for embedded single core 32 bit | |
mcus. It doesn't disable or enable any interrupts. It is safe |
This file has been truncated, but you can view the full file.
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
#-------------------------------------------------------------------- | |
# Makefile - for tiny msp430 preemptive kernel | |
TARGET = tinyos.elf | |
# point this to where your CCS is installed | |
CCS_PATH =? $(HOME)/ti/ccsv6 | |
#ARCH ?= msp430-elf- | |
ARCH ?= msp430- |