Skip to content

Instantly share code, notes, and snippets.

Rick Kimball RickKimball

View GitHub Profile
@RickKimball
RickKimball / main.cpp
Last active Aug 29, 2015
ws281x driver using USCI SPI, with updated asm code for msp430-elf-gcc
View main.cpp
/*
* main.cpp - msp430-elf-gcc ws281x USCI SPI driver using inline asm
*
* Author: kimballr
* Date: Dec 28, 2012
* Version: 0.0002
*
* 2014-09-29 rrk - updated for both msp430-elf-gcc and msp430-gcc
* P1.0 - CS - N/A not used, however it is still useful as an oscilloscope trigger
* P1.7 - MOSI -> WS281x DIN
View buildit.sh
#!/bin/bash
set -x
set -e
#export LU="-Wl,-uTimer0_A0_Handler -Wl,-umain"
export CFLAGS="-I. -mmcu=msp430f5529 -Os -fdata-sections -ffunction-sections"
export LU="-Wl,-uTimer0_A0_Handler,-umain,--gc-section"
export LDFLAGS="-L . -lintr"
@RickKimball
RickKimball / Makefile
Last active Aug 29, 2015
another ringbuffer
View Makefile
all: main
main: main.cpp
gcc -std=c++0x -Os -g -Wall -o $@ $<
clean:
rm -f main
test:
./main
@RickKimball
RickKimball / iomacros.h
Created Aug 22, 2014
msp430-elf-gcc - 4.9.1 alternative iomacros.h
View iomacros.h
/*******************************************************************************
* iomacros.h - hacked version to work with .S files properly
*
* Copyright (C) 2003-2013 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
View ActiveLowLED.h
/*
* ActiveLowLED - class for leds that light up when they are grounded
*/
#include <Arduino.h>
#pragma once
class ActiveLowLED {
private:
const int _pin;
int _initialized;
View issue54.patch
diff --git a/STM32F1/cores/maple/ext_interrupts.h b/STM32F1/cores/maple/ext_interrupts.h
index ce1ca03..a406868 100644
--- a/STM32F1/cores/maple/ext_interrupts.h
+++ b/STM32F1/cores/maple/ext_interrupts.h
@@ -106,7 +106,7 @@ void detachInterrupt(uint8 pin);
*
* @see noInterrupts()
*/
-static __always_inline void interrupts() {
+static inline __always_inline void interrupts() {
@RickKimball
RickKimball / runfast.c
Created May 4, 2011
msp430g2231 - use external square wave from ATTiny @ 12 MHZ as LFXT1 clock
View runfast.c
//***********************************************************
// runfast.c - Using 12MHZ external square wave clock as LFXTCLK
// source MCLK/SMCLK from 12MHZ wave and blink led
// at 60Hz
//
// Use an external clock ( I'm using an attiny running at 12.00 MHZ
// with the CLKOUT fuse enabled ) as the MCLK/SMCLK for the MSP430.
// I've been told you could also use an external oscillator like an
// ECS-100A-160. I ordered some of these to verify.
//
@RickKimball
RickKimball / Makefile
Created May 12, 2011
Simple USCI UART Test code for msp430-gcc uniarch and msp430g2553 hardware
View Makefile
#
# Makefile - usci_serial
#
# License: Do with this code what you want. However, don't blame
# me if you connect it to a heart pump and it stops. This source
# is provided as is with no warranties. It probably has bugs!!
# You have been warned!
#
# Author: Rick Kimball
# email: rick@kimballsoftware.com
@RickKimball
RickKimball / RingBuffer.h
Created May 24, 2011
fabooh core sample code
View RingBuffer.h
/*
* RingBuffer.h - template for a circular buffer
*
* License: Do with this code what you want. However, don't blame
* me if you connect it to a heart pump and it stops. This source
* is provided as is with no warranties. It probably has bugs!!
* You have been warned!
*
* Author: Rick Kimball
* email: rick@kimballsoftware.com
You can’t perform that action at this time.