Skip to content

Instantly share code, notes, and snippets.

View martinribelotta's full-sized avatar
🐒
coding like a monkey

Martin Ribelotta martinribelotta

🐒
coding like a monkey
View GitHub Profile
@martinribelotta
martinribelotta / Makefile
Created March 13, 2017 01:34
Silab hack updated
# Esto crea los defines traductores
silab_hack_head.h: silab_hack.txt
sed 's/^\(.*\)/#define silab_\1 \1/' $< > $@
# esto crea los undef para que no se pisen los codigos
silab_hack_tail.h: silab_hack.txt
sed 's/^\(.*\)/#undef silab_\1 \1/' $< > $@
# definir que silab_hack.h depende de *head.h y *tail.h para que se construyan automaticamente
#define DECL_STRING(name, value) \
char name##_strBuffer[sizeof(value)]; \
String_t name = StringNewFromC(value, name##_strBuffer)
DECL_STRING(a, "Hola mundo");
/*
char a_strBuffer[sizeof("Hola mundo")]; \
String_t a = StringNewFromC("Hola mundo", a_strBuffer)
*/
#ifndef _SAPI_GPIO_H_
#define _SAPI_GPIO_H_
#include "sapi_datatypes.h"
#include "sapi_peripheral_map.h"
/* @question: Bitfield o valores unicos?
* Bitfield permite formar configuraciones no excluyentes que pueden
* tener sentido en muchas arquitecturas:
* GPIO_PULLUP | GPIP_PULLDOWN | GPIO_INPUT <- modo repeater en lpc43xx