Browse Source

clang-format without silly alignment

master
Alex Mikhalev 6 years ago
parent
commit
6965f03068
  1. 4
      .clang-format
  2. 2
      main/Print.cpp
  3. 8
      main/u8g2_esp32_hal.c
  4. 2
      main/ugv.cc
  5. 8
      main/ugv.hh
  6. 2
      main/ugv_comms.cc
  7. 2
      main/ugv_display.cc
  8. 4
      main/ugv_io_gps.cc

4
.clang-format

@ -3,8 +3,8 @@ Language: Cpp @@ -3,8 +3,8 @@ Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true

2
main/Print.cpp

@ -42,7 +42,7 @@ size_t Print::write(const uint8_t *buffer, size_t size) { @@ -42,7 +42,7 @@ size_t Print::write(const uint8_t *buffer, size_t size) {
size_t Print::printf(const char *format, ...) {
char loc_buf[64];
char * temp = loc_buf;
char *temp = loc_buf;
va_list arg;
va_list copy;
va_start(arg, format);

8
main/u8g2_esp32_hal.c

@ -2,15 +2,15 @@ @@ -2,15 +2,15 @@
#include <string.h>
#include "esp_log.h"
#include "sdkconfig.h"
#include "i2c_mutex.h"
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "u8g2_esp32_hal.h"
static const char * TAG = "u8g2_hal";
static const char *TAG = "u8g2_hal";
static const unsigned int I2C_TIMEOUT_MS = 100;
static spi_device_handle_t handle_spi; // SPI handle.
@ -107,8 +107,8 @@ uint8_t u8g2_esp32_i2c_byte_cb(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, @@ -107,8 +107,8 @@ uint8_t u8g2_esp32_i2c_byte_cb(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int,
#define TXBUF_SIZE 32
static uint8_t txbuf[TXBUF_SIZE];
static uint8_t *txbuf_ptr;
// ESP_LOGV(TAG, "i2c_cb: Received a msg: %d, arg_int: %d, arg_ptr: %p", msg,
// arg_int, arg_ptr);
// ESP_LOGV(TAG, "i2c_cb: Received a msg: %d, arg_int: %d, arg_ptr: %p", msg,
// arg_int, arg_ptr);
switch (msg) {
case U8X8_MSG_BYTE_SET_DC: {
if (u8x8->pins[U8X8_PIN_DC] != U8X8_PIN_NONE) {

2
main/ugv.cc

@ -20,7 +20,7 @@ constexpr float ACCEL_NOISE_THRESHOLD = 0.001; @@ -20,7 +20,7 @@ constexpr float ACCEL_NOISE_THRESHOLD = 0.001;
constexpr float GYRO_NOISE_THRESHOLD = 0.3;
void UpdateLocationFromGPS(comms::messages::Location &location,
const io::GpsData & gps_data) {
const io::GpsData &gps_data) {
location.set_fix_quality(gps_data.fix_quality);
location.set_latitude(gps_data.latitude);
location.set_longitude(gps_data.longitude);

8
main/ugv.hh

@ -24,13 +24,13 @@ using ugv::io::IOClass; @@ -24,13 +24,13 @@ using ugv::io::IOClass;
extern "C" void UGV_TickTimeout(void *arg);
void UpdateLocationFromGPS(comms::messages::Location &location,
const io::GpsData & gps_data);
const io::GpsData &gps_data);
class UGV {
private:
CommsClass * comms;
IOClass * io;
DisplayClass * display;
CommsClass *comms;
IOClass *io;
DisplayClass *display;
esp_timer_handle_t timer_handle;
LatLong target_;

2
main/ugv_comms.cc

@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
namespace ugv {
namespace comms {
static const char * TAG = "ugv_comms";
static const char *TAG = "ugv_comms";
static const TickType_t SEND_PERIOD = pdMS_TO_TICKS(15 * 1000);
CommsClass::CommsClass()

2
main/ugv_display.cc

@ -71,7 +71,7 @@ void DisplayClass::Run() { @@ -71,7 +71,7 @@ void DisplayClass::Run() {
heap_info.total_free_bytes);
oled->setCursor(4, 3 * 8);
oled->printf("state: %d", (int) state);
oled->printf("state: %d", (int)state);
if (last_packet_tick > 0) {
double time_since_last_packet =

4
main/ugv_io_gps.cc

@ -167,8 +167,8 @@ void UART_GPS::ProcessLine(const char *line, size_t len) { @@ -167,8 +167,8 @@ void UART_GPS::ProcessLine(const char *line, size_t len) {
data_.pdop = minmea_tofloat(&gsa.pdop);
data_.hdop = minmea_tofloat(&gsa.hdop);
data_.vdop = minmea_tofloat(&gsa.vdop);
ESP_LOGV(TAG, "GSA: pdop=%f, hdop=%f, vdop=%f",
data_.pdop, data_.hdop, data_.vdop);
ESP_LOGV(TAG, "GSA: pdop=%f, hdop=%f, vdop=%f", data_.pdop, data_.hdop,
data_.vdop);
xSemaphoreGive(mutex_);
break;
}

Loading…
Cancel
Save