[CI] Format code according to conventions (#25827)
Format code according to conventions
This commit is contained in:
parent
330a8597f8
commit
6ed61c65dd
92 changed files with 307 additions and 348 deletions
|
|
@ -364,7 +364,7 @@ static bool read_response(char *resp, uint16_t resplen, bool verbose) {
|
|||
}
|
||||
|
||||
static bool at_command(const char *cmd, char *resp, uint16_t resplen, bool verbose, uint16_t timeout) {
|
||||
const char * end = cmd + strlen(cmd);
|
||||
const char *end = cmd + strlen(cmd);
|
||||
struct sdep_msg msg;
|
||||
|
||||
if (verbose) {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
|||
|
||||
void eeprom_write_block(const void *buf, void *addr, size_t len) {
|
||||
uint8_t complete_packet[EXTERNAL_EEPROM_ADDRESS_SIZE + EXTERNAL_EEPROM_PAGE_SIZE];
|
||||
uint8_t * read_buf = (uint8_t *)buf;
|
||||
uint8_t *read_buf = (uint8_t *)buf;
|
||||
uintptr_t target_addr = (uintptr_t)addr;
|
||||
|
||||
#if defined(EXTERNAL_EEPROM_WP_PIN)
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
|||
|
||||
void eeprom_write_block(const void *buf, void *addr, size_t len) {
|
||||
bool res;
|
||||
uint8_t * read_buf = (uint8_t *)buf;
|
||||
uint8_t *read_buf = (uint8_t *)buf;
|
||||
uintptr_t target_addr = (uintptr_t)addr;
|
||||
|
||||
while (len > 0) {
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ void encoder_driver_init(void) {
|
|||
thisCount = isLeftHand ? NUM_ENCODERS_LEFT : NUM_ENCODERS_RIGHT;
|
||||
thatCount = isLeftHand ? NUM_ENCODERS_RIGHT : NUM_ENCODERS_LEFT;
|
||||
#else // SPLIT_KEYBOARD
|
||||
thisCount = NUM_ENCODERS;
|
||||
thisCount = NUM_ENCODERS;
|
||||
#endif
|
||||
|
||||
#ifdef ENCODER_TESTS
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ flash_status_t flash_erase_block(uint32_t addr) {
|
|||
|
||||
flash_status_t flash_read_range(uint32_t addr, void *buf, size_t len) {
|
||||
flash_status_t response = FLASH_STATUS_SUCCESS;
|
||||
uint8_t * read_buf = (uint8_t *)buf;
|
||||
uint8_t *read_buf = (uint8_t *)buf;
|
||||
|
||||
/* Wait for the write-in-progress bit to be cleared. */
|
||||
response = spi_flash_wait_while_busy();
|
||||
|
|
@ -322,7 +322,7 @@ flash_status_t flash_read_range(uint32_t addr, void *buf, size_t len) {
|
|||
|
||||
flash_status_t flash_write_range(uint32_t addr, const void *buf, size_t len) {
|
||||
flash_status_t response = FLASH_STATUS_SUCCESS;
|
||||
uint8_t * write_buf = (uint8_t *)buf;
|
||||
uint8_t *write_buf = (uint8_t *)buf;
|
||||
|
||||
while (len > 0) {
|
||||
uint32_t page_offset = addr % EXTERNAL_FLASH_PAGE_SIZE;
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@
|
|||
|
||||
#ifndef SOLENOID_PINS
|
||||
# ifdef SOLENOID_PIN
|
||||
# define SOLENOID_PINS \
|
||||
{ SOLENOID_PIN }
|
||||
# define SOLENOID_PINS {SOLENOID_PIN}
|
||||
# else
|
||||
# error SOLENOID_PINS array not defined
|
||||
# endif
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
// parts of the display unusable or don't get cleared correctly
|
||||
// and also allows for drawing & inverting
|
||||
uint8_t st7565_buffer[ST7565_MATRIX_SIZE];
|
||||
uint8_t * st7565_cursor;
|
||||
uint8_t *st7565_cursor;
|
||||
ST7565_BLOCK_TYPE st7565_dirty = 0;
|
||||
bool st7565_initialized = false;
|
||||
bool st7565_active = false;
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@
|
|||
#endif
|
||||
|
||||
#ifndef SNLED27351_CURRENT_TUNE
|
||||
# define SNLED27351_CURRENT_TUNE \
|
||||
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
|
||||
# define SNLED27351_CURRENT_TUNE {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
|
||||
#endif
|
||||
|
||||
const uint8_t i2c_addresses[SNLED27351_DRIVER_COUNT] = {
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@
|
|||
#endif
|
||||
|
||||
#ifndef SNLED27351_CURRENT_TUNE
|
||||
# define SNLED27351_CURRENT_TUNE \
|
||||
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
|
||||
# define SNLED27351_CURRENT_TUNE {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
|
||||
#endif
|
||||
|
||||
const uint8_t i2c_addresses[SNLED27351_DRIVER_COUNT] = {
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
// parts of the display unusable or don't get cleared correctly
|
||||
// and also allows for drawing & inverting
|
||||
uint8_t oled_buffer[OLED_MATRIX_SIZE];
|
||||
uint8_t * oled_cursor;
|
||||
uint8_t *oled_cursor;
|
||||
OLED_BLOCK_TYPE oled_dirty = 0;
|
||||
bool oled_initialized = false;
|
||||
bool oled_active = false;
|
||||
|
|
@ -301,24 +301,18 @@ bool oled_init(oled_rotation_t rotation) {
|
|||
oled_driver_init();
|
||||
|
||||
static const uint8_t PROGMEM display_setup1[] = {
|
||||
I2C_CMD,
|
||||
DISPLAY_OFF,
|
||||
DISPLAY_CLOCK,
|
||||
OLED_DISPLAY_CLOCK,
|
||||
MULTIPLEX_RATIO,
|
||||
I2C_CMD, DISPLAY_OFF, DISPLAY_CLOCK, OLED_DISPLAY_CLOCK, MULTIPLEX_RATIO,
|
||||
#if OLED_IC_COM_PINS_ARE_COLUMNS
|
||||
OLED_DISPLAY_WIDTH - 1,
|
||||
#else
|
||||
OLED_DISPLAY_HEIGHT - 1,
|
||||
#endif
|
||||
#if OLED_IC == OLED_IC_SH1107
|
||||
SH1107_DISPLAY_START_LINE,
|
||||
0x00,
|
||||
SH1107_DISPLAY_START_LINE, 0x00,
|
||||
#else
|
||||
DISPLAY_START_LINE | 0x00,
|
||||
#endif
|
||||
CHARGE_PUMP,
|
||||
0x14,
|
||||
CHARGE_PUMP, 0x14,
|
||||
#if OLED_IC_HAS_HORIZONTAL_MODE
|
||||
// MEMORY_MODE is unsupported on SH1106 (Page Addressing only)
|
||||
MEMORY_MODE,
|
||||
|
|
|
|||
|
|
@ -53,12 +53,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
|
||||
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
|
||||
# ifndef OLED_SOURCE_MAP
|
||||
# define OLED_SOURCE_MAP \
|
||||
{ 0, 8, 16, 24, 32, 40, 48, 56 }
|
||||
# define OLED_SOURCE_MAP {0, 8, 16, 24, 32, 40, 48, 56}
|
||||
# endif
|
||||
# ifndef OLED_TARGET_MAP
|
||||
# define OLED_TARGET_MAP \
|
||||
{ 56, 48, 40, 32, 24, 16, 8, 0 }
|
||||
# define OLED_TARGET_MAP {56, 48, 40, 32, 24, 16, 8, 0}
|
||||
# endif
|
||||
// If OLED_BLOCK_TYPE is uint32_t, these tables would look like:
|
||||
// #define OLED_SOURCE_MAP { 32, 40, 48, 56 }
|
||||
|
|
@ -97,12 +95,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
# endif
|
||||
|
||||
# ifndef OLED_SOURCE_MAP
|
||||
# define OLED_SOURCE_MAP \
|
||||
{ 0, 8, 16, 24 }
|
||||
# define OLED_SOURCE_MAP {0, 8, 16, 24}
|
||||
# endif
|
||||
# ifndef OLED_TARGET_MAP
|
||||
# define OLED_TARGET_MAP \
|
||||
{ 24, 16, 8, 0 }
|
||||
# define OLED_TARGET_MAP {24, 16, 8, 0}
|
||||
# endif
|
||||
|
||||
#elif defined(OLED_DISPLAY_64X48)
|
||||
|
|
@ -132,12 +128,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
# endif
|
||||
|
||||
# ifndef OLED_SOURCE_MAP
|
||||
# define OLED_SOURCE_MAP \
|
||||
{ 0, 8 }
|
||||
# define OLED_SOURCE_MAP {0, 8}
|
||||
# endif
|
||||
# ifndef OLED_TARGET_MAP
|
||||
# define OLED_TARGET_MAP \
|
||||
{ 8, 0 }
|
||||
# define OLED_TARGET_MAP {8, 0}
|
||||
# endif
|
||||
|
||||
#elif defined(OLED_DISPLAY_64X128)
|
||||
|
|
@ -170,12 +164,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
# endif
|
||||
|
||||
# ifndef OLED_SOURCE_MAP
|
||||
# define OLED_SOURCE_MAP \
|
||||
{ 0, 8, 16, 24, 32, 40, 48, 56 }
|
||||
# define OLED_SOURCE_MAP {0, 8, 16, 24, 32, 40, 48, 56}
|
||||
# endif
|
||||
# ifndef OLED_TARGET_MAP
|
||||
# define OLED_TARGET_MAP \
|
||||
{ 56, 48, 40, 32, 24, 16, 8, 0 }
|
||||
# define OLED_TARGET_MAP {56, 48, 40, 32, 24, 16, 8, 0}
|
||||
# endif
|
||||
|
||||
#elif defined(OLED_DISPLAY_128X128)
|
||||
|
|
@ -208,12 +200,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
|
||||
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
|
||||
# ifndef OLED_SOURCE_MAP
|
||||
# define OLED_SOURCE_MAP \
|
||||
{ 0, 8, 16, 24, 32, 40, 48, 56 }
|
||||
# define OLED_SOURCE_MAP {0, 8, 16, 24, 32, 40, 48, 56}
|
||||
# endif
|
||||
# ifndef OLED_TARGET_MAP
|
||||
# define OLED_TARGET_MAP \
|
||||
{ 56, 48, 40, 32, 24, 16, 8, 0 }
|
||||
# define OLED_TARGET_MAP {56, 48, 40, 32, 24, 16, 8, 0}
|
||||
# endif
|
||||
#else // defined(OLED_DISPLAY_128X64)
|
||||
// Default 128x32
|
||||
|
|
@ -242,12 +232,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
|
||||
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
|
||||
# ifndef OLED_SOURCE_MAP
|
||||
# define OLED_SOURCE_MAP \
|
||||
{ 0, 8, 16, 24 }
|
||||
# define OLED_SOURCE_MAP {0, 8, 16, 24}
|
||||
# endif
|
||||
# ifndef OLED_TARGET_MAP
|
||||
# define OLED_TARGET_MAP \
|
||||
{ 24, 16, 8, 0 }
|
||||
# define OLED_TARGET_MAP {24, 16, 8, 0}
|
||||
# endif
|
||||
// If OLED_BLOCK_TYPE is uint8_t, these tables would look like:
|
||||
// #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 }
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
// Helpers
|
||||
|
||||
static uint32_t qp_comms_i2c_send_raw(painter_device_t device, const void *data, uint32_t byte_count) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
qp_comms_i2c_config_t *comms_config = (qp_comms_i2c_config_t *)driver->comms_config;
|
||||
i2c_status_t res = i2c_transmit(comms_config->chip_address << 1, data, byte_count, I2C_TIMEOUT);
|
||||
if (res < 0) {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
// Base SPI support
|
||||
|
||||
bool qp_comms_spi_init(painter_device_t device) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_config_t *comms_config = (qp_comms_spi_config_t *)driver->comms_config;
|
||||
|
||||
// Initialize the SPI peripheral
|
||||
|
|
@ -24,7 +24,7 @@ bool qp_comms_spi_init(painter_device_t device) {
|
|||
}
|
||||
|
||||
bool qp_comms_spi_start(painter_device_t device) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_config_t *comms_config = (qp_comms_spi_config_t *)driver->comms_config;
|
||||
|
||||
return spi_start(comms_config->chip_select_pin, comms_config->lsb_first, comms_config->mode, comms_config->divisor);
|
||||
|
|
@ -46,7 +46,7 @@ uint32_t qp_comms_spi_send_data(painter_device_t device, const void *data, uint3
|
|||
}
|
||||
|
||||
bool qp_comms_spi_stop(painter_device_t device) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_config_t *comms_config = (qp_comms_spi_config_t *)driver->comms_config;
|
||||
spi_stop();
|
||||
gpio_write_pin_high(comms_config->chip_select_pin);
|
||||
|
|
@ -70,7 +70,7 @@ bool qp_comms_spi_dc_reset_init(painter_device_t device) {
|
|||
return false;
|
||||
}
|
||||
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
|
||||
|
||||
// Set up D/C as output low, if specified
|
||||
|
|
@ -92,14 +92,14 @@ bool qp_comms_spi_dc_reset_init(painter_device_t device) {
|
|||
}
|
||||
|
||||
uint32_t qp_comms_spi_dc_reset_send_data(painter_device_t device, const void *data, uint32_t byte_count) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
|
||||
gpio_write_pin_high(comms_config->dc_pin);
|
||||
return qp_comms_spi_send_data(device, data, byte_count);
|
||||
}
|
||||
|
||||
bool qp_comms_spi_dc_reset_send_command(painter_device_t device, uint8_t cmd) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
|
||||
gpio_write_pin_low(comms_config->dc_pin);
|
||||
spi_write(cmd);
|
||||
|
|
@ -107,7 +107,7 @@ bool qp_comms_spi_dc_reset_send_command(painter_device_t device, uint8_t cmd) {
|
|||
}
|
||||
|
||||
bool qp_comms_spi_dc_reset_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
|
||||
for (size_t i = 0; i < sequence_len;) {
|
||||
uint8_t command = sequence[i];
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ void qp_surface_update_dirty(surface_dirty_data_t *dirty, uint16_t x, uint16_t y
|
|||
// Driver vtable
|
||||
|
||||
bool qp_surface_init(painter_device_t device, painter_rotation_t rotation) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
surface_painter_device_t *surface = (surface_painter_device_t *)driver;
|
||||
memset(surface->buffer, 0, SURFACE_REQUIRED_BUFFER_BYTE_SIZE(driver->panel_width, driver->panel_height, driver->native_bits_per_pixel));
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ bool qp_surface_clear(painter_device_t device) {
|
|||
}
|
||||
|
||||
bool qp_surface_flush(painter_device_t device) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
surface_painter_device_t *surface = (surface_painter_device_t *)driver;
|
||||
surface->dirty.l = surface->dirty.t = UINT16_MAX;
|
||||
surface->dirty.r = surface->dirty.b = 0;
|
||||
|
|
@ -87,7 +87,7 @@ bool qp_surface_flush(painter_device_t device) {
|
|||
}
|
||||
|
||||
bool qp_surface_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
surface_painter_device_t *surface = (surface_painter_device_t *)driver;
|
||||
|
||||
// Set the viewport locations
|
||||
|
|
@ -106,9 +106,9 @@ bool qp_surface_viewport(painter_device_t device, uint16_t left, uint16_t top, u
|
|||
// Drawing routine to copy out the dirty region and send it to another device
|
||||
|
||||
bool qp_surface_draw(painter_device_t surface, painter_device_t target, uint16_t x, uint16_t y, bool entire_surface) {
|
||||
painter_driver_t * surface_driver = (painter_driver_t *)surface;
|
||||
painter_driver_t *surface_driver = (painter_driver_t *)surface;
|
||||
surface_painter_device_t *surface_handle = (surface_painter_device_t *)surface_driver;
|
||||
painter_driver_t * target_driver = (painter_driver_t *)target;
|
||||
painter_driver_t *target_driver = (painter_driver_t *)target;
|
||||
|
||||
// If we're not dirty... we're done.
|
||||
if (!surface_handle->dirty.is_dirty) {
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ typedef struct surface_painter_device_t {
|
|||
|
||||
// The target buffer
|
||||
union {
|
||||
void * buffer;
|
||||
uint8_t * u8buffer;
|
||||
void *buffer;
|
||||
uint8_t *u8buffer;
|
||||
uint16_t *u16buffer;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ static inline void stream_pixdata_mono1bpp(surface_painter_device_t *surface, co
|
|||
|
||||
// Stream pixel data to the current write position in GRAM
|
||||
static bool qp_surface_pixdata_mono1bpp(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
surface_painter_device_t *surface = (surface_painter_device_t *)driver;
|
||||
stream_pixdata_mono1bpp(surface, (const uint8_t *)pixel_data, native_pixel_count);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ static inline void stream_pixdata_rgb565(surface_painter_device_t *surface, cons
|
|||
|
||||
// Stream pixel data to the current write position in GRAM
|
||||
static bool qp_surface_pixdata_rgb565(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
surface_painter_device_t *surface = (surface_painter_device_t *)driver;
|
||||
stream_pixdata_rgb565(surface, (const uint16_t *)pixel_data, native_pixel_count);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ bool qp_ili9486_init(painter_device_t device, painter_rotation_t rotation) {
|
|||
|
||||
// waveshare variant needs some tweaks due to shift registers
|
||||
static bool qp_comms_spi_dc_reset_send_command_odd_cs_pulse(painter_device_t device, uint8_t cmd) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
|
||||
|
||||
gpio_write_pin_low(comms_config->spi_config.chip_select_pin);
|
||||
|
|
@ -83,7 +83,7 @@ static bool qp_comms_spi_dc_reset_send_command_odd_cs_pulse(painter_device_t dev
|
|||
}
|
||||
|
||||
static uint32_t qp_comms_spi_send_data_odd_cs_pulse(painter_device_t device, const void *data, uint32_t byte_count) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
|
||||
|
||||
uint32_t bytes_remaining = byte_count;
|
||||
|
|
@ -113,7 +113,7 @@ static uint32_t qp_comms_spi_send_data_odd_cs_pulse(painter_device_t device, con
|
|||
}
|
||||
|
||||
static uint32_t qp_ili9486_send_data_toggling(painter_device_t device, const uint8_t *data, uint32_t byte_count) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
|
||||
|
||||
uint32_t ret;
|
||||
|
|
@ -147,7 +147,7 @@ static bool qp_comms_spi_send_command_sequence_odd_cs_pulse(painter_device_t dev
|
|||
}
|
||||
|
||||
static bool qp_ili9486_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
tft_panel_dc_reset_painter_driver_vtable_t *vtable = (tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable;
|
||||
|
||||
// Fix up the drawing location if required
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ uint32_t ld7032_comms_i2c_send_command_and_databuf(painter_device_t device, uint
|
|||
|
||||
// Power control
|
||||
bool qp_ld7032_power(painter_device_t device, bool power_on) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
ld7032_comms_with_command_vtable_t *comms_vtable = (ld7032_comms_with_command_vtable_t *)driver->comms_vtable;
|
||||
|
||||
comms_vtable->send_command_data(device, LD7032_DISP_ON_OFF, power_on ? 0x01 : 0x00);
|
||||
|
|
@ -83,7 +83,7 @@ bool qp_ld7032_clear(painter_device_t device) {
|
|||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ld7032_flush_0(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer, bool inverted) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
ld7032_comms_with_command_vtable_t *comms_vtable = (ld7032_comms_with_command_vtable_t *)driver->comms_vtable;
|
||||
|
||||
int x_start = dirty->l >> 3;
|
||||
|
|
@ -115,7 +115,7 @@ void ld7032_flush_0(painter_device_t device, surface_dirty_data_t *dirty, const
|
|||
}
|
||||
|
||||
void ld7032_flush_90(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer, bool inverted) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
ld7032_comms_with_command_vtable_t *comms_vtable = (ld7032_comms_with_command_vtable_t *)driver->comms_vtable;
|
||||
|
||||
int x_start = dirty->t >> 3;
|
||||
|
|
@ -252,7 +252,7 @@ __attribute__((weak)) bool qp_ld7032_init(painter_device_t device, painter_rotat
|
|||
break;
|
||||
}
|
||||
|
||||
painter_driver_t * pdriver = (painter_driver_t *)device;
|
||||
painter_driver_t *pdriver = (painter_driver_t *)device;
|
||||
ld7032_comms_with_command_vtable_t *comms_vtable = (ld7032_comms_with_command_vtable_t *)pdriver->comms_vtable;
|
||||
|
||||
if (!comms_vtable->send_command_data(device, LD7032_WRITE_DIRECTION, write_direction)) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
// Power control
|
||||
bool qp_oled_panel_power(painter_device_t device, bool power_on) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable;
|
||||
qp_comms_command(device, power_on ? vtable->opcodes.display_on : vtable->opcodes.display_off);
|
||||
return true;
|
||||
|
|
@ -59,7 +59,7 @@ bool qp_oled_panel_passthru_append_pixdata(painter_device_t device, uint8_t *tar
|
|||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void qp_oled_panel_page_column_flush_rot0(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable;
|
||||
|
||||
// TODO: account for offset_x/y in base driver
|
||||
|
|
@ -92,7 +92,7 @@ void qp_oled_panel_page_column_flush_rot0(painter_device_t device, surface_dirty
|
|||
}
|
||||
|
||||
void qp_oled_panel_page_column_flush_rot90(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable;
|
||||
|
||||
// TODO: account for offset_x/y in base driver
|
||||
|
|
@ -126,7 +126,7 @@ void qp_oled_panel_page_column_flush_rot90(painter_device_t device, surface_dirt
|
|||
}
|
||||
|
||||
void qp_oled_panel_page_column_flush_rot180(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable;
|
||||
|
||||
// TODO: account for offset_x/y in base driver
|
||||
|
|
@ -161,7 +161,7 @@ void qp_oled_panel_page_column_flush_rot180(painter_device_t device, surface_dir
|
|||
}
|
||||
|
||||
void qp_oled_panel_page_column_flush_rot270(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable;
|
||||
|
||||
// TODO: account for offset_x/y in base driver
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
// Power control
|
||||
bool qp_tft_panel_power(painter_device_t device, bool power_on) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
tft_panel_dc_reset_painter_driver_vtable_t *vtable = (tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable;
|
||||
qp_comms_command(device, power_on ? vtable->opcodes.display_on : vtable->opcodes.display_off);
|
||||
return true;
|
||||
|
|
@ -33,7 +33,7 @@ bool qp_tft_panel_flush(painter_device_t device) {
|
|||
|
||||
// Viewport to draw to
|
||||
bool qp_tft_panel_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) {
|
||||
painter_driver_t * driver = (painter_driver_t *)device;
|
||||
painter_driver_t *driver = (painter_driver_t *)device;
|
||||
tft_panel_dc_reset_painter_driver_vtable_t *vtable = (tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable;
|
||||
|
||||
// Fix up the drawing location if required
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ void ps2_mouse_task(void) {
|
|||
mouse_report.x = ps2_host_recv_response();
|
||||
mouse_report.y = ps2_host_recv_response();
|
||||
# ifdef PS2_MOUSE_ENABLE_SCROLLING
|
||||
mouse_report.v = -(ps2_host_recv_response() & PS2_MOUSE_SCROLL_MASK);
|
||||
mouse_report.v = -(ps2_host_recv_response() & PS2_MOUSE_SCROLL_MASK);
|
||||
# endif
|
||||
} else {
|
||||
if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n");
|
||||
|
|
|
|||
|
|
@ -477,9 +477,9 @@ report_mouse_t cirque_pinnacle_get_report(report_mouse_t mouse_report) {
|
|||
|
||||
if (touchData.valid) {
|
||||
mouse_report.buttons = touchData.buttons;
|
||||
mouse_report.x = CONSTRAIN_HID_XY(touchData.xDelta);
|
||||
mouse_report.y = CONSTRAIN_HID_XY(touchData.yDelta);
|
||||
mouse_report.v = touchData.wheelCount;
|
||||
mouse_report.x = CONSTRAIN_HID_XY(touchData.xDelta);
|
||||
mouse_report.y = CONSTRAIN_HID_XY(touchData.yDelta);
|
||||
mouse_report.v = touchData.wheelCount;
|
||||
}
|
||||
return mouse_report;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,14 +72,12 @@ STATIC_ASSERT(sizeof((pmw33xx_report_t){0}.motion) == 1, "pmw33xx_report_t.motio
|
|||
# ifndef PMW33XX_CS_PIN
|
||||
# ifdef POINTING_DEVICE_CS_PIN
|
||||
# define PMW33XX_CS_PIN POINTING_DEVICE_CS_PIN
|
||||
# define PMW33XX_CS_PINS \
|
||||
{ PMW33XX_CS_PIN }
|
||||
# define PMW33XX_CS_PINS {PMW33XX_CS_PIN}
|
||||
# else
|
||||
# error "No chip select pin defined -- missing PMW33XX_CS_PIN or PMW33XX_CS_PINS"
|
||||
# endif
|
||||
# else
|
||||
# define PMW33XX_CS_PINS \
|
||||
{ PMW33XX_CS_PIN }
|
||||
# define PMW33XX_CS_PINS {PMW33XX_CS_PIN}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
|
@ -88,8 +86,7 @@ STATIC_ASSERT(sizeof((pmw33xx_report_t){0}.motion) == 1, "pmw33xx_report_t.motio
|
|||
# if !defined(PMW33XX_CS_PIN_RIGHT)
|
||||
# define PMW33XX_CS_PIN_RIGHT PMW33XX_CS_PIN
|
||||
# endif
|
||||
# define PMW33XX_CS_PINS_RIGHT \
|
||||
{ PMW33XX_CS_PIN_RIGHT }
|
||||
# define PMW33XX_CS_PINS_RIGHT {PMW33XX_CS_PIN_RIGHT}
|
||||
#endif
|
||||
|
||||
// Defines so the old variable names are swapped by the appropiate value on each half
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue