Skip to content

Instantly share code, notes, and snippets.

View pabigot's full-sized avatar

Peter A. Bigot pabigot

View GitHub Profile
@pabigot
pabigot / rotate.cc
Created November 19, 2013 18:52
C++11 template function to perform integer rotations without invoking undefined behavior. See http://blog.regehr.org/archives/1063
/* See http://blog.regehr.org/archives/1063
*/
#include <type_traits>
#include <cstdint>
#include <limits>
#include <typeinfo>
#ifndef ARGTYPE
#define ARGTYPE uint32_t
#endif /* ARGTYPE */
@pabigot
pabigot / 00README.md
Last active January 4, 2016 00:49
Files supporting a unit test comparison at http://www.pabigot.com/c/c-unit-test-frameworks/
@pabigot
pabigot / 00README.md
Last active August 29, 2015 13:55
Support for Diagnostics in Template Metaprogramming
@pabigot
pabigot / 00README.md
Last active August 29, 2015 13:55
Examples for a blog post on C++ overloading
#
# Makefile for msp430
#
# 'make' builds everything
# 'make clean' deletes everything except source files and Makefile
# You need to set TARGET, MCU and SOURCES for your project.
# TARGET is the name of the executable file to be produced
# $(TARGET).elf $(TARGET).hex and $(TARGET).txt nad $(TARGET).map are all generated.
# The TXT file is used for BSL loading, the ELF can be used for JTAG use
#
@pabigot
pabigot / Makefile
Last active August 29, 2015 14:01
The Effect of the ARM Cortex-M NOP Instruction
# BSPACM - Makefile for ARM Cortex-M instruction delay experiment
#
# Written in 2014 by Peter A. Bigot <http://pabigot.github.io/bspacm/>
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to
# the public domain worldwide. This software is distributed without
# any warranty.
#
# You should have received a copy of the CC0 Public Domain Dedication
@pabigot
pabigot / main.c
Created January 1, 2015 21:22
DS18B20 one-wire demo on nRF51
/* BSPACM - nRF51 DS18B20 OneWire interface
*
* Copyright 2012-2015, Peter A. Bigot
*
* All rights reserved.
*
* 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 notice,
@pabigot
pabigot / output
Last active September 3, 2016 13:13
pump stream continues after callback
lilith[4835]$ node pb.js
pump cb 2 0 [Error: second call, carrying on]
ws finished 4 49152
@pabigot
pabigot / 0000-README.md
Last active January 3, 2018 19:35
ppk-v11-hangs-on-linux-bug-report patch

Nordic PPK Linux Patches

This gist has patches to the Nordic PPK software to help it run under Linux.

Some other hints:

  • If you get whining about unable to find JLINKARM.dll, modify the
@pabigot
pabigot / README.md
Last active March 30, 2019 14:59
Example code for Nordic devzone issue TBD