|
@@ -8,6 +8,7 @@
|
|
|
//#define Active_ControllerID _Slave1_ID
|
|
//#define Active_ControllerID _Slave1_ID
|
|
|
|
|
|
|
|
#include "Slave_Ports_Status.h"
|
|
#include "Slave_Ports_Status.h"
|
|
|
|
|
+Slave_Ports_Status Slave_Ports_Status_C;
|
|
|
//#include "Slave_Ports_QUEUE.h"
|
|
//#include "Slave_Ports_QUEUE.h"
|
|
|
|
|
|
|
|
//#include "_Slave_Ports_queue_task_type_LIST.h"
|
|
//#include "_Slave_Ports_queue_task_type_LIST.h"
|
|
@@ -16,7 +17,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
//BEGIN CAN
|
|
//BEGIN CAN
|
|
|
-
|
|
|
|
|
|
|
+/*
|
|
|
|
|
|
|
|
#include <mcp_can.h>
|
|
#include <mcp_can.h>
|
|
|
#include <SPI.h>
|
|
#include <SPI.h>
|
|
@@ -29,36 +30,39 @@ MCP_CAN CAN0(CAN_CSpin); // Set CS to pin 10
|
|
|
//EOF CAN
|
|
//EOF CAN
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+*/
|
|
|
|
|
|
|
|
|
|
|
|
|
//REMOTE PORTS DEFINITIONS
|
|
//REMOTE PORTS DEFINITIONS
|
|
|
|
|
|
|
|
// #include "_Slave_Ports.h"
|
|
// #include "_Slave_Ports.h"
|
|
|
|
|
+ /*
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(HAS_ROTTARY_SW)
|
|
#if defined(HAS_ROTTARY_SW)
|
|
|
#include "_ROTTARY_SW.h"
|
|
#include "_ROTTARY_SW.h"
|
|
|
#endif
|
|
#endif
|
|
|
// include the library code
|
|
// include the library code
|
|
|
-/**********************************************************/
|
|
|
|
|
|
|
+
|
|
|
//EOF BEGIN 1602
|
|
//EOF BEGIN 1602
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "_PCINT.h"
|
|
#include "_PCINT.h"
|
|
|
-
|
|
|
|
|
|
|
+#include "_PCINT_loop.h"
|
|
|
|
|
+*/
|
|
|
|
|
+
|
|
|
int Slave_Ports_Status_C_ports_defined = 0;
|
|
int Slave_Ports_Status_C_ports_defined = 0;
|
|
|
- Slave_Ports_Status Slave_Ports_Status_C;
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
void setup() {
|
|
void setup() {
|
|
|
|
|
|
|
|
- Serial.begin(115200);
|
|
|
|
|
|
|
+ Serial.begin(57600);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Slave_Ports_QUEUE Slave_Ports_QUEUE_C;
|
|
// Slave_Ports_QUEUE Slave_Ports_QUEUE_C;
|
|
|
|
|
|
|
|
- #include "_Slave_Ports_LOCAL_LIST.h"
|
|
|
|
|
|
|
+ //#include "_Slave_Ports_LOCAL_LIST.h"
|
|
|
/*AAA
|
|
/*AAA
|
|
|
#if defined(HAS_LCD1602)
|
|
#if defined(HAS_LCD1602)
|
|
|
lcd.begin(16, 2);
|
|
lcd.begin(16, 2);
|
|
@@ -67,18 +71,19 @@ void setup() {
|
|
|
//Slave_Ports_Status_T _add[] = { 1, Active_ControllerID, 0x01, 0x00, 1, 0x01, 0x01, 0x01 };
|
|
//Slave_Ports_Status_T _add[] = { 1, Active_ControllerID, 0x01, 0x00, 1, 0x01, 0x01, 0x01 };
|
|
|
|
|
|
|
|
|
|
|
|
|
- Serial.println("#200 adding ports");
|
|
|
|
|
|
|
+ Serial.println("UUWWW adding ports");
|
|
|
|
|
|
|
|
//todo PCINT service
|
|
//todo PCINT service
|
|
|
-#include "_PCINT_setup.h"
|
|
|
|
|
-
|
|
|
|
|
|
|
+//#include "_PCINT_setup.h"
|
|
|
|
|
|
|
|
|
|
+/*
|
|
|
|
|
|
|
|
#if defined(HAS_ROTTARY_SW)
|
|
#if defined(HAS_ROTTARY_SW)
|
|
|
#include "_ROTTARY_SW_setup.h"
|
|
#include "_ROTTARY_SW_setup.h"
|
|
|
#endif
|
|
#endif
|
|
|
- Serial.println("#231");
|
|
|
|
|
-
|
|
|
|
|
|
|
+*/
|
|
|
|
|
+ Serial.println("CCCAA");
|
|
|
|
|
+/*
|
|
|
|
|
|
|
|
if(CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK) {
|
|
if(CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK) {
|
|
|
|
|
|
|
@@ -96,9 +101,9 @@ void setup() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//EOF CAN
|
|
//EOF CAN
|
|
|
-
|
|
|
|
|
|
|
+ */
|
|
|
|
|
|
|
|
- Serial.println("#298 _Slave_Ports_queue__list");
|
|
|
|
|
|
|
+ Serial.println("WWWF _Slave_Ports_queue__list");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -111,27 +116,33 @@ void setup() {
|
|
|
//String LCDarray1 ;
|
|
//String LCDarray1 ;
|
|
|
//String LCDarray2 ;
|
|
//String LCDarray2 ;
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- unsigned long time;
|
|
|
|
|
-
|
|
|
|
|
- #include "_PCINT_loop.h"
|
|
|
|
|
|
|
+ //unsigned long time;
|
|
|
|
|
+ int loop_id = 0;
|
|
|
|
|
|
|
|
void loop() {
|
|
void loop() {
|
|
|
- Serial.println("#120 :loop " );
|
|
|
|
|
|
|
+ Serial.println("BBCC :loop " );
|
|
|
delay(1000);
|
|
delay(1000);
|
|
|
-
|
|
|
|
|
|
|
+ loop_id ++;
|
|
|
|
|
+ // time = millis();
|
|
|
|
|
+
|
|
|
|
|
|
|
|
if( Slave_Ports_Status_C_ports_defined == 0) {
|
|
if( Slave_Ports_Status_C_ports_defined == 0) {
|
|
|
- Serial.println("#431 : Slave_Ports_Status_C_ports_defined = 0" );
|
|
|
|
|
|
|
+ Serial.println("AAXX Slave_Ports_Status_C_ports_defined = 0" );
|
|
|
Slave_Ports_Status_C_ports_defined = 1;
|
|
Slave_Ports_Status_C_ports_defined = 1;
|
|
|
Slave_Ports_Status_C.add_port( 1, 0x102, 0x01, 0x00, 1, 0x01, 0x01, 0x01, 0x01, 0x00); // Slave_Ports_Status_C.I2C_driver_F(Adafruit_PWMServoDriver)
|
|
Slave_Ports_Status_C.add_port( 1, 0x102, 0x01, 0x00, 1, 0x01, 0x01, 0x01, 0x01, 0x00); // Slave_Ports_Status_C.I2C_driver_F(Adafruit_PWMServoDriver)
|
|
|
- Slave_Ports_Status_C.add_port( 2, 0x102, 0x01, 0x00, 1, 0x01, 0x01, 0x01, 0x01, 0x00); // Slave_Ports_Status_C.I2C_driver_F(Adafruit_PWMServoDriver)
|
|
|
|
|
- // Slave_Ports_Status_C.add_port( 3, 0x102, 0x01, 0x00, 1, 0x01, 0x01, 0x01, 0x01, 0x00); // Slave_Ports_Status_C.I2C_driver_F(Adafruit_PWMServoDriver)
|
|
|
|
|
|
|
+ int _count_get = Slave_Ports_Status_C._count_get();
|
|
|
|
|
+ Serial.print("AVVV S_count_get: " ); Serial.println(_count_get );
|
|
|
|
|
+ // Slave_Ports_Status_C.add_port( 2, 0x102, 0x01, 0x00, 1, 0x01, 0x01, 0x01, 0x01, 0x00); // Slave_Ports_Status_C.I2C_driver_F(Adafruit_PWMServoDriver)
|
|
|
|
|
+ //_count_get = Slave_Ports_Status_C._count_get();
|
|
|
|
|
+ //_count_get = Slave_Ports_Status_C._count_get();
|
|
|
|
|
+ // Slave_Ports_Status_C.add_port( 3, 0x102, 0x01, 0x00, 1, 0x01, 0x01, 0x01, 0x01, 0x00); // Slave_Ports_Status_C.I2C_driver_F(Adafruit_PWMServoDriver)
|
|
|
|
|
+ // _count_get = Slave_Ports_Status_C._count_get();
|
|
|
} else {
|
|
} else {
|
|
|
- Serial.println("#438 : Slave_Ports_Status_C_ports_defined =1" );
|
|
|
|
|
|
|
+ Serial.println("GGHH : Slave_Ports_Status_C_ports_defined =1" );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ Serial.write("Loop " );
|
|
|
|
|
+ Serial.println(loop_id );
|
|
|
|
|
|
|
|
delay(5000);
|
|
delay(5000);
|
|
|
//_LCD_print_buffors_list(_LCD_print_buffors) ;
|
|
//_LCD_print_buffors_list(_LCD_print_buffors) ;
|