before serial in
This commit is contained in:
parent
4eece42354
commit
51605d8d1c
@ -4,7 +4,6 @@
|
|||||||
// CANNode for Teensy 3.1/3.2
|
// CANNode for Teensy 3.1/3.2
|
||||||
// GPLv2
|
// GPLv2
|
||||||
// by wiebel (c) 2015-2018
|
// by wiebel (c) 2015-2018
|
||||||
// github_push_test_01
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <Metro.h>
|
#include <Metro.h>
|
||||||
@ -15,8 +14,8 @@
|
|||||||
// For Node definition:
|
// For Node definition:
|
||||||
|
|
||||||
//#include "Node_1_def.h" // Dachstuhl
|
//#include "Node_1_def.h" // Dachstuhl
|
||||||
//#include "Node_2_def.h" // Werkstatt
|
#include "Node_2_def.h" // Werkstatt
|
||||||
#include "Node_3_def.h" // Keller
|
//#include "Node_3_def.h" // Keller
|
||||||
|
|
||||||
// Metro ticks in ms
|
// Metro ticks in ms
|
||||||
#define METRO_CAN_tick 1
|
#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) {
|
if ( old_state == new_state) {
|
||||||
data[0]=action_map[i].outputs_idx;
|
data[0]=action_map[i].outputs_idx;
|
||||||
data[1]=new_state ^ outputs[action_map[i].outputs_idx].invert;
|
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);
|
CAN_send(NOTIFY, 0x0, STATE_OUT, data, 2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
data[0]=action_map[i].outputs_idx;
|
data[0]=action_map[i].outputs_idx;
|
||||||
data[1]=new_state ^ outputs[action_map[i].outputs_idx].invert;
|
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);
|
CAN_send(NOTIFY, 0x0, NEWSTATE_OUT, data, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user