Compare commits

...

3 Commits

@ -1,4 +1,6 @@
#include <MIDI.h>
#include "pincfg.h"
#include "TimedPin.h"
#include "ui.h"
@ -129,9 +131,21 @@ void MidiCCHandler(byte channel, byte ctrl_no, byte val) {
}
// -----------------------------------------------------------------------------
PinCfg Pins[2];
/***************************************************************************//**
* @brief Initialize pins according pin config settings
*******************************************************************************/
void PinInit() {
Pins[0].Mode = PIN_MODE_DIG_IN;
Pins[0].CfgDigIn.Pullup = PIN_MODE_DIG_IN;
}
// -----------------------------------------------------------------------------
void setup() {
PinInit();
pinMode(pinBtnInc1, INPUT_PULLUP);
pinMode(pinBtnDec1, INPUT_PULLUP);
pinMode(pinBtnInc2, INPUT_PULLUP);

@ -0,0 +1,16 @@
#!/usr/bin/gawk -f
BEGIN {
printf("#ifndef __GITDEFS_H__\n")
printf("#define __GITDEFS_H__\n\n")
printf("/* Do not edit this file */\n")
printf("/* Automatic generated by gitinfo.awk */\n\n\n")
}
NR == 1 { printf("#define GIT_HASH_STR \"%s\"\n", $0); }
NR == 2 { printf("#define GIT_HASH_HEX 0x%s\n", $0); }
NR == 3 { printf("#define GIT_BRANCH_STR \"%s\"\n", $0); }
NR == 4 { printf("#define GIT_VERSION_STR \"%s\"\n", $0); }
NR == 5 { printf("#define GIT_BUILD_NR %u\n", $0);
printf("#define GIT_BUILD_STR \"%s\"\n", $0); }
END { printf("\n\n#endif\n\n"); }

@ -0,0 +1,36 @@
#ifndef __PINCFG_H__
#define __PINCFG_H__
typedef enum: uint8_t {
PIN_MODE_DIG_IN,
PIN_MODE_ANA_IN,
PIN_MODE_DIG_OUT,
PIN_MODE_ANA_OUT
} PIN_MODES;
typedef enum: uint8_t {
PULLUP_OFF,
PULLUP_ON
} PULLUP_MODES;
struct PinCfg {
PIN_MODES Mode;
union {
struct {
PULLUP_MODES Pullup;
} CfgDigIn;
struct {
uint8_t todo;
} CfgAnaIn;
struct {
uint8_t todo;
} CfgDigOut;
struct {
uint8_t todo;
} CfgAnaOut;
};
};
#endif

@ -0,0 +1,9 @@
#!/bin/bash
git describe --abbrev=8 --dirty --always > gitinfo.txt
git describe --abbrev=8 --always >> gitinfo.txt
git rev-parse --abbrev-ref HEAD >> gitinfo.txt
git describe --always --tags --dirty=-d | gawk 'NR==1{print $0}' >> gitinfo.txt
git rev-list HEAD | wc -l | tr -d ' ' >> gitinfo.txt
gawk -f gitinfo.awk < gitinfo.txt > gitdefs.h
rm -f gitinfo.txt

@ -0,0 +1,10 @@
#!/usr/bin/gawk -f
# Execute for every lines
{
umlkey = "//u ";
pos = index($0, umlkey);
if (pos) {
print substr($0, pos + length(umlkey))
}
}

@ -0,0 +1,8 @@
set path=%path%;C:\MinGW\msys\1.0\bin
set PLANTUML=C:\Tools\plantuml\plantuml.jar
if not exist doc mkdir doc
gawk -f uml.awk ui.cpp > doc\ui.uml
cd doc
java -jar %PLANTUML% -charset UTF-8 -tsvg ui.uml
cd ..
Loading…
Cancel
Save