Reformat the file

This commit is contained in:
Matti Airas 2022-04-01 15:24:00 +03:00
parent 64ecf56190
commit 329f02f74e

View File

@ -5,16 +5,16 @@
#define SDA_PIN 16
#define SCL_PIN 17
#include <Wire.h>
#include <ActisenseReader.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <N2kMessages.h>
#include <ActisenseReader.h>
#include <NMEA2000_esp32.h>
#include <ReactESP.h>
#include <Wire.h>
#include <esp_int_wdt.h>
#include <esp_task_wdt.h>
using namespace reactesp;
ReactESP app;
@ -22,16 +22,16 @@ ReactESP app;
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
TwoWire* i2c;
TwoWire *i2c;
Stream *read_stream=&Serial;
Stream *forward_stream=&Serial;
Stream *read_stream = &Serial;
Stream *forward_stream = &Serial;
tActisenseReader actisense_reader;
Adafruit_SSD1306* display;
Adafruit_SSD1306 *display;
tNMEA2000* nmea2000;
tNMEA2000 *nmea2000;
void ToggleLed() {
static bool led_state = false;
@ -85,9 +85,7 @@ void setup() {
// toggle the LED pin at rate of 1 Hz
pinMode(LED_BUILTIN, OUTPUT);
app.onRepeatMicros(1e6 / 1, []() {
ToggleLed();
});
app.onRepeatMicros(1e6 / 1, []() { ToggleLed(); });
// instantiate the NMEA2000 object
nmea2000 = new tNMEA2000_esp32(CAN_TX_PIN, CAN_RX_PIN);
@ -101,11 +99,12 @@ void setup() {
// Set Product information
nmea2000->SetProductInformation(
"20210331", // Manufacturer's Model serial code (max 32 chars)
103, // Manufacturer's product code
"SH-ESP32 NMEA 2000 USB GW", // Manufacturer's Model ID (max 33 chars)
"0.1.0.0 (2021-03-31)", // Manufacturer's Software version code (max 40 chars)
"0.0.3.1 (2021-03-07)" // Manufacturer's Model version (max 24 chars)
"20210331", // Manufacturer's Model serial code (max 32 chars)
103, // Manufacturer's product code
"SH-ESP32 NMEA 2000 USB GW", // Manufacturer's Model ID (max 33 chars)
"0.1.0.0 (2021-03-31)", // Manufacturer's Software version code (max 40
// chars)
"0.0.3.1 (2021-03-07)" // Manufacturer's Model version (max 24 chars)
);
// Set device information
nmea2000->SetDeviceInformation(
@ -120,8 +119,9 @@ void setup() {
nmea2000->SetForwardStream(forward_stream);
nmea2000->SetMode(tNMEA2000::N2km_ListenAndNode);
// nmea2000->SetForwardType(tNMEA2000::fwdt_Text); // Show bus data in clear text
nmea2000->SetForwardOwnMessages(false); // do not echo own messages.
// nmea2000->SetForwardType(tNMEA2000::fwdt_Text); // Show bus data in clear
// text
nmea2000->SetForwardOwnMessages(false); // do not echo own messages.
nmea2000->SetMsgHandler(HandleStreamN2kMsg);
nmea2000->Open();
@ -170,6 +170,4 @@ void setup() {
});
}
void loop() {
app.tick();
}
void loop() { app.tick(); }