mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-08-30 03:19:05 +00:00
Update clang format to 18 (#2891)
* move to clang-format-18 * clang-format-18 indendation
This commit is contained in:
@@ -173,7 +173,7 @@ bool BMPFile::read_next_px(ui::Color& px, bool seek = true) {
|
||||
//*a = (val >> 15) & 0x01; // 1-bit alpha
|
||||
uint8_t r = (val >> 10) & 0x1F; // 5-bit red
|
||||
uint8_t g = (val >> 5) & 0x1F; // 5-bit green
|
||||
uint8_t b = (val)&0x1F; // 5-bit blue
|
||||
uint8_t b = (val) & 0x1F; // 5-bit blue
|
||||
// expand
|
||||
r = (r << 3) | (r >> 2);
|
||||
g = (g << 3) | (g >> 2);
|
||||
@@ -217,7 +217,7 @@ bool BMPFile::read_next_px_cnt(ui::Color* px, uint32_t count, bool seek) {
|
||||
//*a = (val >> 15) & 0x01; // 1-bit alpha
|
||||
uint8_t r = (val >> 10) & 0x1F; // 5-bit red
|
||||
uint8_t g = (val >> 5) & 0x1F; // 5-bit green
|
||||
uint8_t b = (val)&0x1F; // 5-bit blue
|
||||
uint8_t b = (val) & 0x1F; // 5-bit blue
|
||||
// expand
|
||||
r = (r << 3) | (r >> 2);
|
||||
g = (g << 3) | (g >> 2);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace i2cdev {
|
||||
// The device class. You'll derive your from this. Override init() and update();
|
||||
class I2cDev {
|
||||
public:
|
||||
virtual ~I2cDev(){};
|
||||
virtual ~I2cDev() {};
|
||||
virtual bool init(uint8_t addr) = 0; // returns true if it is that that device we are looking for.
|
||||
virtual void update() = 0; // override this, and you'll be able to query your device and broadcast the result to the system
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class ManchesterBase {
|
||||
|
||||
virtual size_t symbols_count() const;
|
||||
|
||||
virtual ~ManchesterBase(){};
|
||||
virtual ~ManchesterBase() {};
|
||||
|
||||
protected:
|
||||
const baseband::Packet& packet;
|
||||
|
||||
@@ -55,8 +55,7 @@ class MessageQueue {
|
||||
const bool result = push(message);
|
||||
if (result) {
|
||||
// TODO: More graceful method of waiting for empty? Maybe sleep for a bit?
|
||||
while (!is_empty())
|
||||
;
|
||||
while (!is_empty());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
#define MATRIX_A 0x9908b0dfUL /* constant vector a */
|
||||
#define UMASK 0x80000000UL /* most significant w-r bits */
|
||||
#define LMASK 0x7fffffffUL /* least significant r bits */
|
||||
#define MIXBITS(u, v) (((u)&UMASK) | ((v)&LMASK))
|
||||
#define TWIST(u, v) ((MIXBITS(u, v) >> 1) ^ ((v)&1UL ? MATRIX_A : 0UL))
|
||||
#define MIXBITS(u, v) (((u) & UMASK) | ((v) & LMASK))
|
||||
#define TWIST(u, v) ((MIXBITS(u, v) >> 1) ^ ((v) & 1UL ? MATRIX_A : 0UL))
|
||||
|
||||
/* initializes state[N] with a seed */
|
||||
extern void init_genrand(unsigned long s);
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace sstv {
|
||||
#define SSTV_SAMPLERATE 3072000
|
||||
#define SSTV_DELTA_COEF ((1ULL << 32) / SSTV_SAMPLERATE)
|
||||
|
||||
#define SSTV_F2D(f) (uint32_t)((f)*SSTV_DELTA_COEF)
|
||||
#define SSTV_F2D(f) (uint32_t)((f) * SSTV_DELTA_COEF)
|
||||
#define SSTV_MS2S(d) (uint32_t)((d) / 1000.0 * (float)SSTV_SAMPLERATE)
|
||||
|
||||
#define SSTV_VIS_SS SSTV_F2D(1200)
|
||||
|
||||
@@ -36,29 +36,29 @@ namespace ui {
|
||||
// default font width
|
||||
#define UI_POS_DEFAULT_WIDTH 8
|
||||
// px position of the linenum-th character (Y)
|
||||
#define UI_POS_Y(linenum) ((int)((linenum)*UI_POS_DEFAULT_HEIGHT))
|
||||
#define UI_POS_Y(linenum) ((int)((linenum) * UI_POS_DEFAULT_HEIGHT))
|
||||
// px position of the linenum-th character from the bottom of the screen (Y) (please calculate the +1 line top-bar to it too if that is visible!)
|
||||
#define UI_POS_Y_BOTTOM(linenum) ((int)(screen_height - (linenum)*UI_POS_DEFAULT_HEIGHT))
|
||||
#define UI_POS_Y_BOTTOM(linenum) ((int)(screen_height - (linenum) * UI_POS_DEFAULT_HEIGHT))
|
||||
// px position of the linenum-th character from the left of the screen (X)
|
||||
#define UI_POS_X(charnum) ((int)((charnum)*UI_POS_DEFAULT_WIDTH))
|
||||
#define UI_POS_X(charnum) ((int)((charnum) * UI_POS_DEFAULT_WIDTH))
|
||||
// px position of the linenum-th character from the right of the screen (X)
|
||||
#define UI_POS_X_RIGHT(charnum) ((int)(screen_width - ((charnum)*UI_POS_DEFAULT_WIDTH)))
|
||||
#define UI_POS_X_RIGHT(charnum) ((int)(screen_width - ((charnum) * UI_POS_DEFAULT_WIDTH)))
|
||||
// px position of the left character from the center of the screen (X) (for N character wide string)
|
||||
#define UI_POS_X_CENTER(charnum) ((int)((screen_width / 2) - ((charnum)*UI_POS_DEFAULT_WIDTH / 2)))
|
||||
#define UI_POS_X_CENTER(charnum) ((int)((screen_width / 2) - ((charnum) * UI_POS_DEFAULT_WIDTH / 2)))
|
||||
// px position of the currcol in a table with colnum number of columns, where one coloumn is charnum characters wide maximum
|
||||
#define UI_POS_X_TABLE(colnum, currcol) ((currcol) * (screen_width / (colnum)))
|
||||
// px width of N characters
|
||||
#define UI_POS_WIDTH(charnum) ((int)((charnum)*UI_POS_DEFAULT_WIDTH))
|
||||
#define UI_POS_WIDTH(charnum) ((int)((charnum) * UI_POS_DEFAULT_WIDTH))
|
||||
// px width of the screen
|
||||
#define UI_POS_MAXWIDTH (screen_width)
|
||||
// px height of N line
|
||||
#define UI_POS_HEIGHT(linecount) ((int)((linecount)*UI_POS_DEFAULT_HEIGHT))
|
||||
#define UI_POS_HEIGHT(linecount) ((int)((linecount) * UI_POS_DEFAULT_HEIGHT))
|
||||
// px height of the screen's percent
|
||||
#define UI_POS_HEIGHT_PERCENT(percent) ((int)(screen_height * (percent) / 100))
|
||||
// remaining px from the linenum-th line to the bottom of the screen. (please calculate the +1 line top-bar to it too if that is visible!)
|
||||
#define UI_POS_HEIGHT_REMAINING(linenum) ((int)(screen_height - ((linenum)*UI_POS_DEFAULT_HEIGHT)))
|
||||
#define UI_POS_HEIGHT_REMAINING(linenum) ((int)(screen_height - ((linenum) * UI_POS_DEFAULT_HEIGHT)))
|
||||
// remaining px from the charnum-th character to the right of the screen
|
||||
#define UI_POS_WIDTH_REMAINING(charnum) ((int)(screen_width - ((charnum)*UI_POS_DEFAULT_WIDTH)))
|
||||
#define UI_POS_WIDTH_REMAINING(charnum) ((int)(screen_width - ((charnum) * UI_POS_DEFAULT_WIDTH)))
|
||||
// px width of the screen's percent
|
||||
#define UI_POS_WIDTH_PERCENT(percent) ((int)(screen_width * (percent) / 100))
|
||||
// px width of the screen
|
||||
|
||||
@@ -65,7 +65,7 @@ class Widget;
|
||||
|
||||
class Painter {
|
||||
public:
|
||||
Painter(){};
|
||||
Painter() {};
|
||||
|
||||
Painter(const Painter&) = delete;
|
||||
Painter(Painter&&) = delete;
|
||||
|
||||
@@ -343,8 +343,8 @@ class WM8731 : public audio::Codec {
|
||||
headphone_mute();
|
||||
}
|
||||
|
||||
void speaker_enable(){};
|
||||
void speaker_disable(){};
|
||||
void speaker_enable() {};
|
||||
void speaker_disable() {};
|
||||
bool speaker_disable_supported() const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user