Serial6 KEYWORD1 | Serial6 KEYWORD1 | ||||
Serial7 KEYWORD1 | Serial7 KEYWORD1 | ||||
Serial8 KEYWORD1 | Serial8 KEYWORD1 | ||||
SerialUSB1 KEYWORD1 | |||||
SerialUSB2 KEYWORD1 | |||||
setRX KEYWORD2 | setRX KEYWORD2 | ||||
setTX KEYWORD2 | setTX KEYWORD2 | ||||
write9bit KEYWORD2 | write9bit KEYWORD2 |
#define CDC_ACM_SIZE 16 | #define CDC_ACM_SIZE 16 | ||||
#define CDC_RX_SIZE 64 | #define CDC_RX_SIZE 64 | ||||
#define CDC_TX_SIZE 64 | #define CDC_TX_SIZE 64 | ||||
#define CDC2_STATUS_INTERFACE 2 // SerialA | |||||
#define CDC2_STATUS_INTERFACE 2 // SerialUSB1 | |||||
#define CDC2_DATA_INTERFACE 3 | #define CDC2_DATA_INTERFACE 3 | ||||
#define CDC2_ACM_ENDPOINT 5 | #define CDC2_ACM_ENDPOINT 5 | ||||
#define CDC2_RX_ENDPOINT 6 | #define CDC2_RX_ENDPOINT 6 | ||||
#define CDC_ACM_SIZE 16 | #define CDC_ACM_SIZE 16 | ||||
#define CDC_RX_SIZE 64 | #define CDC_RX_SIZE 64 | ||||
#define CDC_TX_SIZE 64 | #define CDC_TX_SIZE 64 | ||||
#define CDC2_STATUS_INTERFACE 2 // SerialA | |||||
#define CDC2_STATUS_INTERFACE 2 // SerialUSB1 | |||||
#define CDC2_DATA_INTERFACE 3 | #define CDC2_DATA_INTERFACE 3 | ||||
#define CDC2_ACM_ENDPOINT 5 | #define CDC2_ACM_ENDPOINT 5 | ||||
#define CDC2_RX_ENDPOINT 6 | #define CDC2_RX_ENDPOINT 6 | ||||
#define CDC2_ACM_SIZE 16 | #define CDC2_ACM_SIZE 16 | ||||
#define CDC2_RX_SIZE 64 | #define CDC2_RX_SIZE 64 | ||||
#define CDC2_TX_SIZE 64 | #define CDC2_TX_SIZE 64 | ||||
#define CDC3_STATUS_INTERFACE 4 // SerialB | |||||
#define CDC3_STATUS_INTERFACE 4 // SerialUSB2 | |||||
#define CDC3_DATA_INTERFACE 5 | #define CDC3_DATA_INTERFACE 5 | ||||
#define CDC3_ACM_ENDPOINT 8 | #define CDC3_ACM_ENDPOINT 8 | ||||
#define CDC3_RX_ENDPOINT 9 | #define CDC3_RX_ENDPOINT 9 |
#ifdef CDC2_DATA_INTERFACE | #ifdef CDC2_DATA_INTERFACE | ||||
#ifdef CDC2_STATUS_INTERFACE | #ifdef CDC2_STATUS_INTERFACE | ||||
usb_serial2_class SerialA; | |||||
usb_serial2_class SerialUSB1; | |||||
#endif | #endif | ||||
#endif | #endif | ||||
#ifdef CDC3_DATA_INTERFACE | #ifdef CDC3_DATA_INTERFACE | ||||
#ifdef CDC3_STATUS_INTERFACE | #ifdef CDC3_STATUS_INTERFACE | ||||
usb_serial3_class SerialB; | |||||
usb_serial3_class SerialUSB2; | |||||
#endif | #endif | ||||
#endif | #endif | ||||
void serialEvent() __attribute__((weak)); | void serialEvent() __attribute__((weak)); | ||||
void serialEvent() {} | void serialEvent() {} | ||||
void serialEventA() __attribute__((weak)); | |||||
void serialEventA() {} | |||||
void serialEventB() __attribute__((weak)); | |||||
void serialEventB() {} | |||||
void serialEventUSB1() __attribute__((weak)); | |||||
void serialEventUSB1() {} | |||||
void serialEventUSB2() __attribute__((weak)); | |||||
void serialEventUSB2() {} |
} | } | ||||
}; | }; | ||||
extern usb_serial2_class SerialA; | |||||
extern void serialEventA(void); | |||||
extern usb_serial2_class SerialUSB1; | |||||
extern void serialEventUSB1(void); | |||||
#endif // __cplusplus | #endif // __cplusplus | ||||
#endif // F_CPU | #endif // F_CPU |
} | } | ||||
}; | }; | ||||
extern usb_serial3_class SerialB; | |||||
extern void serialEventB(void); | |||||
extern usb_serial3_class SerialUSB2; | |||||
extern void serialEventUSB2(void); | |||||
#endif // __cplusplus | #endif // __cplusplus | ||||
#endif // F_CPU | #endif // F_CPU |
running = 1; | running = 1; | ||||
if (Serial.available()) serialEvent(); | if (Serial.available()) serialEvent(); | ||||
#if defined(USB_DUAL_SERIAL) || defined(USB_TRIPLE_SERIAL) | #if defined(USB_DUAL_SERIAL) || defined(USB_TRIPLE_SERIAL) | ||||
if (SerialA.available()) serialEventA(); | |||||
if (SerialUSB1.available()) serialEventUSB1(); | |||||
#endif | #endif | ||||
#ifdef USB_TRIPLE_SERIAL | #ifdef USB_TRIPLE_SERIAL | ||||
if (SerialB.available()) serialEventB(); | |||||
if (SerialUSB2.available()) serialEventUSB2(); | |||||
#endif | #endif | ||||
if (Serial1.available()) serialEvent1(); | if (Serial1.available()) serialEvent1(); | ||||
if (Serial2.available()) serialEvent2(); | if (Serial2.available()) serialEvent2(); |
#define CDC_TX_SIZE_480 512 | #define CDC_TX_SIZE_480 512 | ||||
#define CDC_RX_SIZE_12 64 | #define CDC_RX_SIZE_12 64 | ||||
#define CDC_TX_SIZE_12 64 | #define CDC_TX_SIZE_12 64 | ||||
#define CDC2_STATUS_INTERFACE 2 // SerialA | |||||
#define CDC2_STATUS_INTERFACE 2 // SerialUSB1 | |||||
#define CDC2_DATA_INTERFACE 3 | #define CDC2_DATA_INTERFACE 3 | ||||
#define CDC2_ACM_ENDPOINT 4 | #define CDC2_ACM_ENDPOINT 4 | ||||
#define CDC2_RX_ENDPOINT 5 | #define CDC2_RX_ENDPOINT 5 | ||||
#define CDC_TX_SIZE_480 512 | #define CDC_TX_SIZE_480 512 | ||||
#define CDC_RX_SIZE_12 64 | #define CDC_RX_SIZE_12 64 | ||||
#define CDC_TX_SIZE_12 64 | #define CDC_TX_SIZE_12 64 | ||||
#define CDC2_STATUS_INTERFACE 2 // SerialA | |||||
#define CDC2_STATUS_INTERFACE 2 // SerialUSB1 | |||||
#define CDC2_DATA_INTERFACE 3 | #define CDC2_DATA_INTERFACE 3 | ||||
#define CDC2_ACM_ENDPOINT 4 | #define CDC2_ACM_ENDPOINT 4 | ||||
#define CDC2_RX_ENDPOINT 5 | #define CDC2_RX_ENDPOINT 5 | ||||
#define CDC2_TX_ENDPOINT 5 | #define CDC2_TX_ENDPOINT 5 | ||||
#define CDC3_STATUS_INTERFACE 4 // SerialB | |||||
#define CDC3_STATUS_INTERFACE 4 // SerialUSB2 | |||||
#define CDC3_DATA_INTERFACE 5 | #define CDC3_DATA_INTERFACE 5 | ||||
#define CDC3_ACM_ENDPOINT 6 | #define CDC3_ACM_ENDPOINT 6 | ||||
#define CDC3_RX_ENDPOINT 7 | #define CDC3_RX_ENDPOINT 7 |
} | } | ||||
}; | }; | ||||
extern usb_serial2_class SerialA; | |||||
extern void serialEventA(void); | |||||
extern usb_serial2_class SerialUSB1; | |||||
extern void serialEventUSB1(void); | |||||
#endif // __cplusplus | #endif // __cplusplus | ||||
#endif // CDC2_STATUS_INTERFACE && CDC2_DATA_INTERFACE | #endif // CDC2_STATUS_INTERFACE && CDC2_DATA_INTERFACE | ||||
} | } | ||||
}; | }; | ||||
extern usb_serial3_class SerialB; | |||||
extern void serialEventB(void); | |||||
extern usb_serial3_class SerialUSB2; | |||||
extern void serialEventUSB2(void); | |||||
#endif // __cplusplus | #endif // __cplusplus | ||||
#endif // CDC3_STATUS_INTERFACE && CDC3_DATA_INTERFACE | #endif // CDC3_STATUS_INTERFACE && CDC3_DATA_INTERFACE |