Skip to content

Instantly share code, notes, and snippets.

enum class ASCII : char
{
eNUL,
eSOH,
eSTX,
eETX,
eEOT,
eENQ,
eACK,
eBEL,
@b1ackviking
b1ackviking / cortex-gcc-flags.txt
Created March 1, 2021 12:06
GCC compiler options for Cortex cores (extract from GNU Tools for ARM Embedded Processors readme)
Architecture options usage
--------------------------------------------------------------------
| ARM Core | Command Line Options | multilib |
|----------|--------------------------------------------|----------|
|Cortex-M0+| -mthumb -mcpu=cortex-m0plus | armv6-m |
|Cortex-M0 | -mthumb -mcpu=cortex-m0 | |
|Cortex-M1 | -mthumb -mcpu=cortex-m1 | |
| |--------------------------------------------| |
| | -mthumb -march=armv6-m | |
|----------|--------------------------------------------|----------|
@b1ackviking
b1ackviking / gcc-includes.cmake
Created March 2, 2021 07:29
Extracting GCC system include directories
set(GCC_INCLUDE_DIRECTORIES)
if(WIN32)
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -v -x c++ -E NUL
ERROR_VARIABLE _gcc_output
OUTPUT_QUIET)
else()
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -v -x c++ -E -
#include <cstddef>
#include <tuple>
template<class F>
struct function_traits;
// function pointer
template<class R, class... Args>
struct function_traits<R(*)(Args...)> : public function_traits<R(Args...)>
{};
@b1ackviking
b1ackviking / macros.sh
Created September 10, 2022 14:48
Get predefined macros from gcc and clang
echo | g++ -dM -E -
echo | clang++ -dM -E -
@b1ackviking
b1ackviking / crc_v3.txt
Created September 10, 2022 14:55
A PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS
A PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS
==================================================
"Everything you wanted to know about CRC algorithms, but were afraid
to ask for fear that errors in your understanding might be detected."
Version : 3.
Date : 19 August 1993.
Author : Ross N. Williams.
Net : ross@guest.adelaide.edu.au.