Browse Source

Merge branch 'led'

remotes/github/master
wiebel 6 years ago
parent
commit
e1371357e7
  1. 6
      src/CANNode.cpp
  2. 2
      src/Node_1_def.h
  3. 34
      src/Node_2_def.h
  4. 7
      src/Node_3_def.h

6
src/CANNode.cpp

@ -1,11 +1,10 @@
#include <Arduino.h> #include <Arduino.h>
#define FASTLED_ALLOW_INTERRUPTS 0
// ------------------------------------------------------------- // -------------------------------------------------------------
// CANNode for Teensy 3.1/3.2 // CANNode for Teensy 3.1/3.2
// //
// by wiebel // by wiebel
// foo //
#include <Metro.h> #include <Metro.h>
#include <FlexCAN.h> #include <FlexCAN.h>
@ -14,7 +13,7 @@
// For Node definition: // For Node definition:
#include "Node_1_def.h" #include "Node_2_def.h"
// Metro ticks in ms // Metro ticks in ms
#define METRO_CAN_tick 1 #define METRO_CAN_tick 1
@ -37,7 +36,6 @@
#define PIO_B 0x40 #define PIO_B 0x40
#define DS2406_BUF_LEN 10 #define DS2406_BUF_LEN 10
// Initialisation // Initialisation
// Misc // Misc
#if DEBUG #if DEBUG

2
src/Node_1_def.h

@ -69,7 +69,7 @@ static event_t tx_events[N_EVENTS] PROGMEM={
{ 6, 0x03, 0x01, TOGGLE, 0x06}, { 6, 0x03, 0x01, TOGGLE, 0x06},
{ 7, 0x03, 0x01, TOGGLE, 0x07}, { 7, 0x03, 0x01, TOGGLE, 0x07},
{ 8, 0x03, 0x01, TOGGLE, 0x08}, { 8, 0x03, 0x01, TOGGLE, 0x08},
{ 9, 0x03, 0x03, TOGGLE, 0x02}, { 9, 0x03, 0x02, TOGGLE, 0x03},
{ 11, 0x03, 0x01, ON, 0x01}, { 11, 0x03, 0x01, ON, 0x01},
{ 12, 0x03, 0x01, ON, 0x02}, { 12, 0x03, 0x01, ON, 0x02},
{ 255, 0x03, 0xff, OFF, 0x09}, { 255, 0x03, 0xff, OFF, 0x09},

34
src/Node_2_def.h

@ -29,24 +29,21 @@ static uint8_t node_id PROGMEM= { NODE_ID };
static OW_switch_t switches[N_SWITCHES] PROGMEM={ static OW_switch_t switches[N_SWITCHES] PROGMEM={
// nick, addr[8], event_tag[pioA_FALL, pioA_RISE, pioB_FALL, pioB_RISE] // nick, addr[8], event_tag[pioA_FALL, pioA_RISE, pioB_FALL, pioB_RISE]
{ 255, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, { 0, 0, 0, 0 } }, { 255, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, { 0, 0, 0, 0 } },
{ 11, { 0x12, 0xF2, 0x2A, 0x66, 0x0, 0x0, 0x0, 0x41 }, { 1, 1, 1, 1 } }, { 21, { 0x12, 0x86, 0xB4, 0x54, 0x0, 0x0, 0x0, 0x5F }, { 23, 23, 37, 37 } }, // Flur
{ 12, { 0x12, 0x37, 0x8A, 0x4F, 0x0, 0x0, 0x0, 0xE5 }, { 2, 2, 2, 2 } }, { 22, { 0x12, 0x5E, 0xFF, 0x55, 0x0, 0x0, 0x0, 0x2C }, { 21, 21, 22, 22 } }, // WZ
{ 21, { 0x12, 0x86, 0xB4, 0x54, 0x0, 0x0, 0x0, 0x5F }, { 3, 3, 4, 4 } },
{ 22, { 0x12, 0x84, 0xAD, 0x4F, 0x0, 0x0, 0x0, 0x12 }, { 5, 5, 6, 6 } },
{ 31, { 0x12, 0x88, 0xDD, 0x53, 0x0, 0x0, 0x0, 0x28 }, { 210, 211, 220, 221 } }, // Roldenschalter (A - UP, B - DOWN)
{ 0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, { 0, 0, 0, 0 } } { 0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, { 0, 0, 0, 0 } }
}; };
static uint8_t switches_state[N_SWITCHES]; static uint8_t switches_state[N_SWITCHES];
static outputs_t outputs[N_OUTPUTS] PROGMEM={ static outputs_t outputs[N_OUTPUTS] PROGMEM={
// type, address(PIN), initial value, inverted // type, address(PIN), initial value, inverted
{ GPIO, 0, 0, true }, // 0 { GPIO, 18, 0, true }, // 0
{ GPIO, 1, 0, true }, // 1 { GPIO, 19, 0, true }, // 1
{ GPIO, 23, 255, true }, // 2 { GPIO, 16, 0, true }, // 2
{ GPIO, 22, 0, true }, // 3 { GPIO, 17, 0, true }, // 3
{ GPIO, 17, 0, true }, // 4 { GPIO, 22, 0, true }, // 4
{ GPIO, 16, 0, true }, // 5 { GPIO, 23, 0, true }, // 5
{ GPIO, 9, 255, true }, // 6 { GPIO, 1, 0, true }, // 6
{ GPIO, 10, 0, true }, // 7 { GPIO, 0, 0, true }, // 7
{ NOP, 0xFF, 0, 0 } { NOP, 0xFF, 0, 0 }
}; };
static uint8_t outputs_state[N_OUTPUTS]; static uint8_t outputs_state[N_OUTPUTS];
@ -57,13 +54,14 @@ static uint8_t outputs_state[N_OUTPUTS];
static event_t tx_events[N_EVENTS] PROGMEM={ static event_t tx_events[N_EVENTS] PROGMEM={
// | --- ID --- | // | --- ID --- |
// tag, prio, dst, cmd, data // tag, prio, dst, cmd, data
{ 1, 0x03, 0x01, OFF, 0x01}, { 21, 0x03, 0x02, TOGGLE, 0x01},
{ 2, 0x03, 0x01, OFF, 0x02}, { 22, 0x03, 0x02, TOGGLE, 0x02},
{ 3, 0x03, 0x01, TOGGLE, 0x03}, { 23, 0x03, 0x02, TOGGLE, 0x03},
{ 4, 0x03, 0x01, TOGGLE, 0x04}, { 13, 0x03, 0x01, TOGGLE, 0x03},
{ 14, 0x03, 0x01, TOGGLE, 0x04},
{ 5, 0x03, 0x01, TOGGLE, 0x05}, { 5, 0x03, 0x01, TOGGLE, 0x05},
{ 6, 0x03, 0x01, TOGGLE, 0x06}, { 6, 0x03, 0x01, TOGGLE, 0x06},
{ 7, 0x03, 0x01, TOGGLE, 0x07}, { 37, 0x03, 0x03, TOGGLE, 0x07},
{ 8, 0x03, 0x01, TOGGLE, 0x08}, { 8, 0x03, 0x01, TOGGLE, 0x08},
{ 11, 0x03, 0x01, ON, 0x01}, { 11, 0x03, 0x01, ON, 0x01},
{ 12, 0x03, 0x01, ON, 0x02}, { 12, 0x03, 0x01, ON, 0x02},

7
src/Node_3_def.h

@ -40,12 +40,17 @@ static outputs_t outputs[N_OUTPUTS] PROGMEM={
// type, address(PIN), initial value, inverted // type, address(PIN), initial value, inverted
{ GPIO, 0, 0, true }, // 0 { GPIO, 0, 0, true }, // 0
{ GPIO, 1, 0, true }, // 1 { GPIO, 1, 0, true }, // 1
{ GPIO, 23, 255, true }, // 2 { GPIO, 23, 0, true }, // 2
{ GPIO, 22, 0, true }, // 3 { GPIO, 22, 0, true }, // 3
{ GPIO, 17, 0, true }, // 4 { GPIO, 17, 0, true }, // 4
{ GPIO, 16, 0, true }, // 5 { GPIO, 16, 0, true }, // 5
<<<<<<< HEAD
{ GPIO, 9, 255, true }, // 6 { GPIO, 9, 255, true }, // 6
{ GPIO, 10, 0, true }, // 7 { GPIO, 10, 0, true }, // 7
=======
{ GPIO, 19, 0, true }, // 6
{ GPIO, 18, 0, true }, // 7
>>>>>>> led
{ NOP, 0xFF, 0, 0 } { NOP, 0xFF, 0, 0 }
}; };
static uint8_t outputs_state[N_OUTPUTS]; static uint8_t outputs_state[N_OUTPUTS];

Loading…
Cancel
Save