Browse Source

before serial in

master
wiebel 8 months ago
parent
commit
51605d8d1c
  1. 7
      src/CANNode.cpp

7
src/CANNode.cpp

@ -4,7 +4,6 @@
// CANNode for Teensy 3.1/3.2
// GPLv2
// by wiebel (c) 2015-2018
// github_push_test_01
#include <vector>
#include <Metro.h>
@ -15,8 +14,8 @@
// For Node definition:
//#include "Node_1_def.h" // Dachstuhl
//#include "Node_2_def.h" // Werkstatt
#include "Node_3_def.h" // Keller
#include "Node_2_def.h" // Werkstatt
//#include "Node_3_def.h" // Keller
// Metro ticks in ms
#define METRO_CAN_tick 1
@ -221,11 +220,13 @@ for (uint8_t i = 0; action_map[i].tag != 0 ; i++) {
if ( old_state == new_state) {
data[0]=action_map[i].outputs_idx;
data[1]=new_state ^ outputs[action_map[i].outputs_idx].invert;
Serial.println(F("Sending nochange to CAN"));
CAN_send(NOTIFY, 0x0, STATE_OUT, data, 2);
}
else {
data[0]=action_map[i].outputs_idx;
data[1]=new_state ^ outputs[action_map[i].outputs_idx].invert;
Serial.println(F("Sending change to CAN"));
CAN_send(NOTIFY, 0x0, NEWSTATE_OUT, data, 2);
}
}

Loading…
Cancel
Save