Skip to content

Instantly share code, notes, and snippets.

View ndomx's full-sized avatar

Nicolas Dominguez ndomx

View GitHub Profile
@ndomx
ndomx / CMakeLists.txt
Last active April 29, 2023 01:08
RPi Pico W Minimal CMake file with wifi included
# CMakeLists.txt
# Based on the example CMake file provided by the official documentation
# this sample file allows you to connect your pico w to the internet
# without any further setup (wifi ssid and password are not included,
# you can include those values directly in the cmake command or declare them
# in an untracked header file)
#
# note: be sure to copy the header lwipopts.h to your workspace (it can
# be found in the examples: pico-examples/pico_w/wifi/lwipopts_examples_common.h).
# The workspace should look like this:
@ndomx
ndomx / gpio.c
Created July 16, 2022 22:33
GPIO toggle in AVR8 native code
/**
* Toggle GPIO port PB1 (Arduino port 9)
*
* Note: This code only works with
* AVR 8-bit family micro-controllers
*/
#include <avr/io.h>
int main(void)
@ndomx
ndomx / Makefile
Created January 30, 2021 22:16
Makefile for simple ATmega C projects
MCU = atmega328p
DUDEMCU = m328p
PROG = usbasp
OPT = s
CPPFLAGS = -DF_CPU=16000000 -O$(OPT)
CFLAGS = -mmcu=$(MCU)
TARGET = main
@ndomx
ndomx / .clang-format
Last active October 23, 2022 22:01
My .clang-format for VS Code
BasedOnStyle: Microsoft
IndentCaseLabels: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
SpaceAfterCStyleCast: true
PointerAlignment: Left
BitFieldColonSpacing: None
BreakBeforeBraces: Allman
@ndomx
ndomx / avr-gcc-cpp-configuration.json
Last active January 11, 2024 19:59
C/C++ configuration for AVR boards in VS Code
{
"name": "atmega328p",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"__AVR_ATmega328P__"
],
"compilerPath": "{path-to-avr-gcc}/avr-gcc",
"cStandard": "c99",