Pretty printed the Arduino code with astyle

This commit is contained in:
Baozhu Zuo
2020-02-03 15:00:22 +08:00
parent 7d41ceb28a
commit 7d30ccccc8
17 changed files with 1268 additions and 1407 deletions
+10 -19
View File
@@ -5,9 +5,9 @@
/*SAMD core*/
#ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE
#define SERIAL SerialUSB
#define SERIAL SerialUSB
#else
#define SERIAL Serial
#define SERIAL Serial
#endif
#define SPI_CS_PIN 10
@@ -15,38 +15,29 @@
MCP_CAN CAN(SPI_CS_PIN); // Set CS pin
void setup()
{
void setup() {
SERIAL.begin(115200);
while (CAN_OK != CAN.begin(CAN_500KBPS)) // init can bus : baudrate = 500k
{
while (CAN_OK != CAN.begin(CAN_500KBPS)) { // init can bus : baudrate = 500k
SERIAL.println("CAN init failed, retry");
delay(100);
}
SERIAL.println("CAN init ok");
if(CAN.mcpPinMode(MCP_RX0BF, MCP_PIN_OUT))
{
if (CAN.mcpPinMode(MCP_RX0BF, MCP_PIN_OUT)) {
SERIAL.println("RX0BF is now an output");
}
else
{
} else {
SERIAL.println("Could not switch RX0BF");
}
if(CAN.mcpPinMode(MCP_RX1BF, MCP_PIN_OUT))
{
if (CAN.mcpPinMode(MCP_RX1BF, MCP_PIN_OUT)) {
SERIAL.println("RX1BF is now an output");
}
else
{
} else {
SERIAL.println("Could not switch RX1BF");
}
}
void loop()
{
void loop() {
SERIAL.println("10");
CAN.mcpDigitalWrite(MCP_RX0BF, HIGH);
CAN.mcpDigitalWrite(MCP_RX1BF, LOW);
@@ -58,5 +49,5 @@ void loop()
}
/*********************************************************************************************************
END FILE
END FILE
*********************************************************************************************************/