Cleanup make includes and formatting rules (#1860)

* Draft cleanup of the folder definition mess

* Move old startup

* Fixup! broken hacky includes

* Update Makefile

* Update Makefile

* Update Makefile

* Bulk format

* Who knew, header guards are a wise idea

* Squash some sizing warnings

* Drop broken usb stack

* Fix BLE headers to be sensible

* Cleaning up proper c styling

* We have newer clang, it does bracketing now

* Run clang-format brackets

* We can drop the old messy bracket-checker with newer clang format

* WiP formatter

* Align grids of scripts by right side

Massively easier to read in nearly all cases

* Excempt the table for compression from formatter
This commit is contained in:
Ben V. Brown
2023-12-27 09:23:12 +11:00
committed by GitHub
parent 849d1f7d40
commit ec5f07ec0c
248 changed files with 58306 additions and 70269 deletions

View File

@@ -10,19 +10,21 @@
#include "LIS2DH12.hpp"
#include "cmsis_os.h"
static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {{LIS_CTRL_REG1, 0x17, 0}, // 25Hz
{LIS_CTRL_REG2, 0b00001000, 0}, // Highpass filter off
{LIS_CTRL_REG3, 0b01100000, 0}, // Setup interrupt pins
{LIS_CTRL_REG4, 0b00001000, 0}, // Block update mode off, HR on
{LIS_CTRL_REG5, 0b00000010, 0}, //
{LIS_CTRL_REG6, 0b01100010, 0},
// Basically setup the unit to run, and enable 4D orientation detection
{LIS_INT2_CFG, 0b01111110, 0}, // setup for movement detection
{LIS_INT2_THS, 0x28, 0}, //
{LIS_INT2_DURATION, 64, 0}, //
{LIS_INT1_CFG, 0b01111110, 0}, //
{LIS_INT1_THS, 0x28, 0}, //
{LIS_INT1_DURATION, 64, 0}};
static const ACCEL_I2C_CLASS::I2C_REG i2c_registers[] = {
{ LIS_CTRL_REG1, 0x17, 0}, // 25Hz
{ LIS_CTRL_REG2, 0b00001000, 0}, // Highpass filter off
{ LIS_CTRL_REG3, 0b01100000, 0}, // Setup interrupt pins
{ LIS_CTRL_REG4, 0b00001000, 0}, // Block update mode off, HR on
{ LIS_CTRL_REG5, 0b00000010, 0}, //
{ LIS_CTRL_REG6, 0b01100010, 0},
// Basically setup the unit to run, and enable 4D orientation detection
{ LIS_INT2_CFG, 0b01111110, 0}, // setup for movement detection
{ LIS_INT2_THS, 0x28, 0}, //
{LIS_INT2_DURATION, 64, 0}, //
{ LIS_INT1_CFG, 0b01111110, 0}, //
{ LIS_INT1_THS, 0x28, 0}, //
{LIS_INT1_DURATION, 64, 0}
};
bool LIS2DH12::initalize() { return ACCEL_I2C_CLASS::writeRegistersBulk(LIS2DH_I2C_ADDRESS, i2c_registers, sizeof(i2c_registers) / sizeof(i2c_registers[0])); }