Merge remote-tracking branch 'upstream/develop' into 22927-turn-off-osl-on-nesting

This commit is contained in:
Krister Svanlund 2024-01-28 19:59:04 +01:00
commit a36ab56149
93 changed files with 558 additions and 899 deletions

View File

@ -38,20 +38,20 @@ bool g_led_control_registers_update_required = false;
void is31fl3218_write_register(uint8_t reg, uint8_t data) {
#if IS31FL3218_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3218_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(IS31FL3218_I2C_ADDRESS << 1, reg, &data, 1, IS31FL3218_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, reg, &data, 1, IS31FL3218_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(IS31FL3218_I2C_ADDRESS << 1, reg, &data, 1, IS31FL3218_I2C_TIMEOUT);
i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, reg, &data, 1, IS31FL3218_I2C_TIMEOUT);
#endif
}
void is31fl3218_write_pwm_buffer(uint8_t *pwm_buffer) {
void is31fl3218_write_pwm_buffer(void) {
#if IS31FL3218_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3218_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(IS31FL3218_I2C_ADDRESS << 1, IS31FL3218_REG_PWM, pwm_buffer, 18, IS31FL3218_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, IS31FL3218_REG_PWM, g_pwm_buffer, 18, IS31FL3218_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(IS31FL3218_I2C_ADDRESS << 1, IS31FL3218_REG_PWM, pwm_buffer, 18, IS31FL3218_I2C_TIMEOUT);
i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, IS31FL3218_REG_PWM, g_pwm_buffer, 18, IS31FL3218_I2C_TIMEOUT);
#endif
}
@ -123,7 +123,7 @@ void is31fl3218_set_led_control_register(uint8_t index, bool value) {
void is31fl3218_update_pwm_buffers(void) {
if (g_pwm_buffer_update_required) {
is31fl3218_write_pwm_buffer(g_pwm_buffer);
is31fl3218_write_pwm_buffer();
// Load PWM registers and LED Control register data
is31fl3218_write_register(IS31FL3218_REG_UPDATE, 0x01);

View File

@ -38,20 +38,20 @@ bool g_led_control_registers_update_required = false;
void is31fl3218_write_register(uint8_t reg, uint8_t data) {
#if IS31FL3218_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3218_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(IS31FL3218_I2C_ADDRESS << 1, reg, &data, 1, IS31FL3218_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, reg, &data, 1, IS31FL3218_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(IS31FL3218_I2C_ADDRESS << 1, reg, &data, 1, IS31FL3218_I2C_TIMEOUT);
i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, reg, &data, 1, IS31FL3218_I2C_TIMEOUT);
#endif
}
void is31fl3218_write_pwm_buffer(uint8_t *pwm_buffer) {
void is31fl3218_write_pwm_buffer(void) {
#if IS31FL3218_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3218_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(IS31FL3218_I2C_ADDRESS << 1, IS31FL3218_REG_PWM, pwm_buffer, 18, IS31FL3218_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, IS31FL3218_REG_PWM, g_pwm_buffer, 18, IS31FL3218_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(IS31FL3218_I2C_ADDRESS << 1, IS31FL3218_REG_PWM, pwm_buffer, 18, IS31FL3218_I2C_TIMEOUT);
i2c_write_register(IS31FL3218_I2C_ADDRESS << 1, IS31FL3218_REG_PWM, g_pwm_buffer, 18, IS31FL3218_I2C_TIMEOUT);
#endif
}
@ -139,7 +139,7 @@ void is31fl3218_set_led_control_register(uint8_t index, bool red, bool green, bo
void is31fl3218_update_pwm_buffers(void) {
if (g_pwm_buffer_update_required) {
is31fl3218_write_pwm_buffer(g_pwm_buffer);
is31fl3218_write_pwm_buffer();
// Load PWM registers and LED Control register data
is31fl3218_write_register(IS31FL3218_REG_UPDATE, 0x01);

View File

@ -46,10 +46,10 @@ bool g_led_control_registers_update_required[IS31FL3731_DRIVER_COUNT]
void is31fl3731_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3731_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3731_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3731_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3731_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3731_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3731_I2C_TIMEOUT);
#endif
}
@ -57,7 +57,7 @@ void is31fl3731_select_page(uint8_t addr, uint8_t page) {
is31fl3731_write_register(addr, IS31FL3731_REG_COMMAND, page);
}
void is31fl3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3731_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 0 is already selected.
// Transmit PWM registers in 9 transfers of 16 bytes.
@ -65,10 +65,10 @@ void is31fl3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3731_PWM_REGISTER_COUNT; i += 16) {
#if IS31FL3731_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3731_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, IS31FL3731_FRAME_REG_PWM + i, pwm_buffer + i, 16, IS31FL3731_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, IS31FL3731_FRAME_REG_PWM + i, g_pwm_buffer[index] + i, 16, IS31FL3731_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, IS31FL3731_FRAME_REG_PWM + i, pwm_buffer + i, 16, IS31FL3731_I2C_TIMEOUT);
i2c_write_register(addr << 1, IS31FL3731_FRAME_REG_PWM + i, g_pwm_buffer[index] + i, 16, IS31FL3731_I2C_TIMEOUT);
#endif
}
}
@ -194,7 +194,7 @@ void is31fl3731_set_led_control_register(uint8_t index, bool value) {
void is31fl3731_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3731_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3731_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -108,7 +108,6 @@ void is31fl3731_init_drivers(void);
void is31fl3731_init(uint8_t addr);
void is31fl3731_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3731_select_page(uint8_t addr, uint8_t page);
void is31fl3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3731_set_value(int index, uint8_t value);
void is31fl3731_set_value_all(uint8_t value);

View File

@ -45,10 +45,10 @@ bool g_led_control_registers_update_required[IS31FL3731_DRIVER_COUNT]
void is31fl3731_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3731_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3731_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3731_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3731_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3731_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3731_I2C_TIMEOUT);
#endif
}
@ -56,7 +56,7 @@ void is31fl3731_select_page(uint8_t addr, uint8_t page) {
is31fl3731_write_register(addr, IS31FL3731_REG_COMMAND, page);
}
void is31fl3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3731_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 0 is already selected.
// Transmit PWM registers in 9 transfers of 16 bytes.
@ -64,10 +64,10 @@ void is31fl3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3731_PWM_REGISTER_COUNT; i += 16) {
#if IS31FL3731_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3731_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, IS31FL3731_FRAME_REG_PWM + i, pwm_buffer + i, 16, IS31FL3731_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, IS31FL3731_FRAME_REG_PWM + i, g_pwm_buffer[index] + i, 16, IS31FL3731_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, IS31FL3731_FRAME_REG_PWM + i, pwm_buffer + i, 16, IS31FL3731_I2C_TIMEOUT);
i2c_write_register(addr << 1, IS31FL3731_FRAME_REG_PWM + i, g_pwm_buffer[index] + i, 16, IS31FL3731_I2C_TIMEOUT);
#endif
}
}
@ -209,7 +209,7 @@ void is31fl3731_set_led_control_register(uint8_t index, bool red, bool green, bo
void is31fl3731_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3731_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3731_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -109,7 +109,6 @@ void is31fl3731_init_drivers(void);
void is31fl3731_init(uint8_t addr);
void is31fl3731_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3731_select_page(uint8_t addr, uint8_t page);
void is31fl3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3731_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void is31fl3731_set_color_all(uint8_t red, uint8_t green, uint8_t blue);

View File

@ -77,10 +77,10 @@ bool g_led_control_registers_update_required[IS31FL3733_DRIVER_COUNT]
void is31fl3733_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3733_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3733_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT);
#endif
}
@ -89,7 +89,7 @@ void is31fl3733_select_page(uint8_t addr, uint8_t page) {
is31fl3733_write_register(addr, IS31FL3733_REG_COMMAND, page);
}
void is31fl3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3733_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 1 is already selected.
// Transmit PWM registers in 12 transfers of 16 bytes.
@ -97,10 +97,10 @@ void is31fl3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3733_PWM_REGISTER_COUNT; i += 16) {
#if IS31FL3733_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3733_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, IS31FL3733_I2C_TIMEOUT);
i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3733_I2C_TIMEOUT);
#endif
}
}
@ -213,7 +213,7 @@ void is31fl3733_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3733_select_page(addr, IS31FL3733_COMMAND_PWM);
is31fl3733_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3733_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -118,7 +118,6 @@ void is31fl3733_init_drivers(void);
void is31fl3733_init(uint8_t addr, uint8_t sync);
void is31fl3733_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3733_select_page(uint8_t addr, uint8_t page);
void is31fl3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3733_set_value(int index, uint8_t value);
void is31fl3733_set_value_all(uint8_t value);

View File

@ -76,10 +76,10 @@ bool g_led_control_registers_update_required[IS31FL3733_DRIVER_COUNT]
void is31fl3733_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3733_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3733_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT);
#endif
}
@ -88,7 +88,7 @@ void is31fl3733_select_page(uint8_t addr, uint8_t page) {
is31fl3733_write_register(addr, IS31FL3733_REG_COMMAND, page);
}
void is31fl3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3733_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 1 is already selected.
// Transmit PWM registers in 12 transfers of 16 bytes.
@ -96,10 +96,10 @@ void is31fl3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3733_PWM_REGISTER_COUNT; i += 16) {
#if IS31FL3733_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3733_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, IS31FL3733_I2C_TIMEOUT);
i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3733_I2C_TIMEOUT);
#endif
}
}
@ -228,7 +228,7 @@ void is31fl3733_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3733_select_page(addr, IS31FL3733_COMMAND_PWM);
is31fl3733_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3733_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -143,7 +143,6 @@ void is31fl3733_init_drivers(void);
void is31fl3733_init(uint8_t addr, uint8_t sync);
void is31fl3733_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3733_select_page(uint8_t addr, uint8_t page);
void is31fl3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void is31fl3733_set_color_all(uint8_t red, uint8_t green, uint8_t blue);

View File

@ -61,10 +61,10 @@ bool g_led_control_registers_update_required[IS31FL3736_DRIVER_COUNT]
void is31fl3736_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3736_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3736_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3736_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3736_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3736_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3736_I2C_TIMEOUT);
#endif
}
@ -73,7 +73,7 @@ void is31fl3736_select_page(uint8_t addr, uint8_t page) {
is31fl3736_write_register(addr, IS31FL3736_REG_COMMAND, page);
}
void is31fl3736_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3736_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 1 is already selected.
// Transmit PWM registers in 12 transfers of 16 bytes.
@ -81,10 +81,10 @@ void is31fl3736_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3736_PWM_REGISTER_COUNT; i += 16) {
#if IS31FL3736_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3736_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, IS31FL3736_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3736_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, IS31FL3736_I2C_TIMEOUT);
i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3736_I2C_TIMEOUT);
#endif
}
}
@ -202,7 +202,7 @@ void is31fl3736_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3736_select_page(addr, IS31FL3736_COMMAND_PWM);
is31fl3736_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3736_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -113,7 +113,6 @@ void is31fl3736_init_drivers(void);
void is31fl3736_init(uint8_t addr);
void is31fl3736_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3736_select_page(uint8_t addr, uint8_t page);
void is31fl3736_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3736_set_value(int index, uint8_t value);
void is31fl3736_set_value_all(uint8_t value);

View File

@ -61,10 +61,10 @@ bool g_led_control_registers_update_required[IS31FL3736_DRIVER_COUNT]
void is31fl3736_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3736_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3736_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3736_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3736_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3736_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3736_I2C_TIMEOUT);
#endif
}
@ -73,7 +73,7 @@ void is31fl3736_select_page(uint8_t addr, uint8_t page) {
is31fl3736_write_register(addr, IS31FL3736_REG_COMMAND, page);
}
void is31fl3736_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3736_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 1 is already selected.
// Transmit PWM registers in 12 transfers of 16 bytes.
@ -81,10 +81,10 @@ void is31fl3736_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3736_PWM_REGISTER_COUNT; i += 16) {
#if IS31FL3736_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3736_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, IS31FL3736_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3736_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, IS31FL3736_I2C_TIMEOUT);
i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3736_I2C_TIMEOUT);
#endif
}
}
@ -219,7 +219,7 @@ void is31fl3736_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3736_select_page(addr, IS31FL3736_COMMAND_PWM);
is31fl3736_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3736_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -127,7 +127,6 @@ void is31fl3736_init_drivers(void);
void is31fl3736_init(uint8_t addr);
void is31fl3736_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3736_select_page(uint8_t addr, uint8_t page);
void is31fl3736_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3736_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void is31fl3736_set_color_all(uint8_t red, uint8_t green, uint8_t blue);

View File

@ -64,10 +64,10 @@ bool g_led_control_registers_update_required[IS31FL3737_DRIVER_COUNT]
void is31fl3737_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3737_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3737_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3737_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3737_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3737_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3737_I2C_TIMEOUT);
#endif
}
@ -76,7 +76,7 @@ void is31fl3737_select_page(uint8_t addr, uint8_t page) {
is31fl3737_write_register(addr, IS31FL3737_REG_COMMAND, page);
}
void is31fl3737_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3737_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 1 is already selected.
// Transmit PWM registers in 12 transfers of 16 bytes.
@ -84,10 +84,10 @@ void is31fl3737_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3737_PWM_REGISTER_COUNT; i += 16) {
#if IS31FL3737_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3737_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, IS31FL3737_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3737_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, IS31FL3737_I2C_TIMEOUT);
i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3737_I2C_TIMEOUT);
#endif
}
}
@ -199,7 +199,7 @@ void is31fl3737_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3737_select_page(addr, IS31FL3737_COMMAND_PWM);
is31fl3737_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3737_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -103,7 +103,6 @@ void is31fl3737_init_drivers(void);
void is31fl3737_init(uint8_t addr);
void is31fl3737_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3737_select_page(uint8_t addr, uint8_t page);
void is31fl3737_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3737_set_value(int index, uint8_t value);
void is31fl3737_set_value_all(uint8_t value);

View File

@ -64,10 +64,10 @@ bool g_led_control_registers_update_required[IS31FL3737_DRIVER_COUNT]
void is31fl3737_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3737_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3737_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3737_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3737_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3737_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3737_I2C_TIMEOUT);
#endif
}
@ -76,7 +76,7 @@ void is31fl3737_select_page(uint8_t addr, uint8_t page) {
is31fl3737_write_register(addr, IS31FL3737_REG_COMMAND, page);
}
void is31fl3737_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3737_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 1 is already selected.
// Transmit PWM registers in 12 transfers of 16 bytes.
@ -84,10 +84,10 @@ void is31fl3737_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3737_PWM_REGISTER_COUNT; i += 16) {
#if IS31FL3737_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3737_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, IS31FL3737_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3737_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, IS31FL3737_I2C_TIMEOUT);
i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3737_I2C_TIMEOUT);
#endif
}
}
@ -215,7 +215,7 @@ void is31fl3737_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3737_select_page(addr, IS31FL3737_COMMAND_PWM);
is31fl3737_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3737_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -120,7 +120,6 @@ void is31fl3737_init_drivers(void);
void is31fl3737_init(uint8_t addr);
void is31fl3737_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3737_select_page(uint8_t addr, uint8_t page);
void is31fl3737_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void is31fl3737_set_color_all(uint8_t red, uint8_t green, uint8_t blue);

View File

@ -67,10 +67,10 @@ uint8_t g_scaling_registers[IS31FL3741_DRIVER_COUNT][IS31FL3741_SCALING_REGISTER
void is31fl3741_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3741_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3741_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3741_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3741_I2C_TIMEOUT);
#endif
}
@ -79,7 +79,7 @@ void is31fl3741_select_page(uint8_t addr, uint8_t page) {
is31fl3741_write_register(addr, IS31FL3741_REG_COMMAND, page);
}
void is31fl3741_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3741_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assume page 0 is already selected
for (uint16_t i = 0; i < 342; i += 18) {
@ -89,20 +89,20 @@ void is31fl3741_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
#if IS31FL3741_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3741_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i % 180, pwm_buffer + i, 18, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i % 180, g_pwm_buffer[index] + i, 18, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i % 180, pwm_buffer + i, 18, IS31FL3741_I2C_TIMEOUT);
i2c_write_register(addr << 1, i % 180, g_pwm_buffer[index] + i, 18, IS31FL3741_I2C_TIMEOUT);
#endif
}
// transfer the left cause the total number is 351
#if IS31FL3741_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3741_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, 162, pwm_buffer + 342, 9, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, 162, g_pwm_buffer[index] + 342, 9, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, 162, pwm_buffer + 342, 9, IS31FL3741_I2C_TIMEOUT);
i2c_write_register(addr << 1, 162, g_pwm_buffer[index] + 342, 9, IS31FL3741_I2C_TIMEOUT);
#endif
}
@ -199,7 +199,7 @@ void is31fl3741_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3741_select_page(addr, IS31FL3741_COMMAND_PWM_0);
is31fl3741_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3741_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -105,7 +105,6 @@ void is31fl3741_init_drivers(void);
void is31fl3741_init(uint8_t addr);
void is31fl3741_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3741_select_page(uint8_t addr, uint8_t page);
void is31fl3741_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3741_set_value(int index, uint8_t value);
void is31fl3741_set_value_all(uint8_t value);

View File

@ -67,10 +67,10 @@ uint8_t g_scaling_registers[IS31FL3741_DRIVER_COUNT][IS31FL3741_SCALING_REGISTER
void is31fl3741_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3741_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3741_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3741_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3741_I2C_TIMEOUT);
#endif
}
@ -79,7 +79,7 @@ void is31fl3741_select_page(uint8_t addr, uint8_t page) {
is31fl3741_write_register(addr, IS31FL3741_REG_COMMAND, page);
}
void is31fl3741_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3741_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assume page 0 is already selected
for (uint16_t i = 0; i < 342; i += 18) {
@ -89,20 +89,20 @@ void is31fl3741_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
#if IS31FL3741_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3741_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i % 180, pwm_buffer + i, 18, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i % 180, g_pwm_buffer[index] + i, 18, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i % 180, pwm_buffer + i, 18, IS31FL3741_I2C_TIMEOUT);
i2c_write_register(addr << 1, i % 180, g_pwm_buffer[index] + i, 18, IS31FL3741_I2C_TIMEOUT);
#endif
}
// transfer the left cause the total number is 351
#if IS31FL3741_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3741_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, 162, pwm_buffer + 342, 9, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, 162, g_pwm_buffer[index] + 342, 9, IS31FL3741_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, 162, pwm_buffer + 342, 9, IS31FL3741_I2C_TIMEOUT);
i2c_write_register(addr << 1, 162, g_pwm_buffer[index] + 342, 9, IS31FL3741_I2C_TIMEOUT);
#endif
}
@ -213,7 +213,7 @@ void is31fl3741_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3741_select_page(addr, IS31FL3741_COMMAND_PWM_0);
is31fl3741_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3741_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -122,7 +122,6 @@ void is31fl3741_init_drivers(void);
void is31fl3741_init(uint8_t addr);
void is31fl3741_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3741_select_page(uint8_t addr, uint8_t page);
void is31fl3741_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3741_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void is31fl3741_set_color_all(uint8_t red, uint8_t green, uint8_t blue);

View File

@ -62,10 +62,10 @@ uint8_t g_scaling_registers[IS31FL3742A_DRIVER_COUNT][IS31FL3742A_SCALING_REGIST
void is31fl3742a_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3742A_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3742A_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3742A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3742A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3742A_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3742A_I2C_TIMEOUT);
#endif
}
@ -74,7 +74,7 @@ void is31fl3742a_select_page(uint8_t addr, uint8_t page) {
is31fl3742a_write_register(addr, IS31FL3742A_REG_COMMAND, page);
}
void is31fl3742a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3742a_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 0 is already selected.
// Transmit PWM registers in 6 transfers of 30 bytes.
@ -82,10 +82,10 @@ void is31fl3742a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3742A_PWM_REGISTER_COUNT; i += 30) {
#if IS31FL3742A_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3742A_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i, pwm_buffer + i, 30, IS31FL3742A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 30, IS31FL3742A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i, pwm_buffer + i, 30, IS31FL3742A_I2C_TIMEOUT);
i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 30, IS31FL3742A_I2C_TIMEOUT);
#endif
}
}
@ -183,7 +183,7 @@ void is31fl3742a_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3742a_select_page(addr, IS31FL3742A_COMMAND_PWM);
is31fl3742a_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3742a_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -75,7 +75,6 @@ void is31fl3742a_init_drivers(void);
void is31fl3742a_init(uint8_t addr);
void is31fl3742a_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3742a_select_page(uint8_t addr, uint8_t page);
void is31fl3742a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3742a_set_value(int index, uint8_t value);
void is31fl3742a_set_value_all(uint8_t value);

View File

@ -62,10 +62,10 @@ uint8_t g_scaling_registers[IS31FL3742A_DRIVER_COUNT][IS31FL3742A_SCALING_REGIST
void is31fl3742a_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3742A_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3742A_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3742A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3742A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3742A_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3742A_I2C_TIMEOUT);
#endif
}
@ -74,7 +74,7 @@ void is31fl3742a_select_page(uint8_t addr, uint8_t page) {
is31fl3742a_write_register(addr, IS31FL3742A_REG_COMMAND, page);
}
void is31fl3742a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3742a_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 0 is already selected.
// Transmit PWM registers in 6 transfers of 30 bytes.
@ -82,10 +82,10 @@ void is31fl3742a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3742A_PWM_REGISTER_COUNT; i += 30) {
#if IS31FL3742A_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3742A_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i, pwm_buffer + i, 30, IS31FL3742A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 30, IS31FL3742A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i, pwm_buffer + i, 30, IS31FL3742A_I2C_TIMEOUT);
i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 30, IS31FL3742A_I2C_TIMEOUT);
#endif
}
}
@ -187,7 +187,7 @@ void is31fl3742a_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3742a_select_page(addr, IS31FL3742A_COMMAND_PWM);
is31fl3742a_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3742a_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -77,7 +77,6 @@ void is31fl3742a_init_drivers(void);
void is31fl3742a_init(uint8_t addr);
void is31fl3742a_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3742a_select_page(uint8_t addr, uint8_t page);
void is31fl3742a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3742a_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void is31fl3742a_set_color_all(uint8_t red, uint8_t green, uint8_t blue);

View File

@ -71,10 +71,10 @@ uint8_t g_scaling_registers[IS31FL3743A_DRIVER_COUNT][IS31FL3743A_SCALING_REGIST
void is31fl3743a_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3743A_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3743A_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3743A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3743A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3743A_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3743A_I2C_TIMEOUT);
#endif
}
@ -83,7 +83,7 @@ void is31fl3743a_select_page(uint8_t addr, uint8_t page) {
is31fl3743a_write_register(addr, IS31FL3743A_REG_COMMAND, page);
}
void is31fl3743a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3743a_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 0 is already selected.
// Transmit PWM registers in 11 transfers of 18 bytes.
@ -91,10 +91,10 @@ void is31fl3743a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3743A_PWM_REGISTER_COUNT; i += 18) {
#if IS31FL3743A_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3743A_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i + 1, pwm_buffer + i, 18, IS31FL3743A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i + 1, g_pwm_buffer[index] + i, 18, IS31FL3743A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i + 1, pwm_buffer + i, 18, IS31FL3743A_I2C_TIMEOUT);
i2c_write_register(addr << 1, i + 1, g_pwm_buffer[index] + i, 18, IS31FL3743A_I2C_TIMEOUT);
#endif
}
}
@ -192,7 +192,7 @@ void is31fl3743a_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3743a_select_page(addr, IS31FL3743A_COMMAND_PWM);
is31fl3743a_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3743a_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -85,7 +85,6 @@ void is31fl3743a_init_drivers(void);
void is31fl3743a_init(uint8_t addr, uint8_t sync);
void is31fl3743a_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3743a_select_page(uint8_t addr, uint8_t page);
void is31fl3743a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3743a_set_value(int index, uint8_t value);
void is31fl3743a_set_value_all(uint8_t value);

View File

@ -71,10 +71,10 @@ uint8_t g_scaling_registers[IS31FL3743A_DRIVER_COUNT][IS31FL3743A_SCALING_REGIST
void is31fl3743a_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3743A_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3743A_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3743A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3743A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3743A_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3743A_I2C_TIMEOUT);
#endif
}
@ -83,7 +83,7 @@ void is31fl3743a_select_page(uint8_t addr, uint8_t page) {
is31fl3743a_write_register(addr, IS31FL3743A_REG_COMMAND, page);
}
void is31fl3743a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3743a_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 0 is already selected.
// Transmit PWM registers in 11 transfers of 18 bytes.
@ -91,10 +91,10 @@ void is31fl3743a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3743A_PWM_REGISTER_COUNT; i += 18) {
#if IS31FL3743A_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3743A_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i + 1, pwm_buffer + i, 18, IS31FL3743A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i + 1, g_pwm_buffer[index] + i, 18, IS31FL3743A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i + 1, pwm_buffer + i, 18, IS31FL3743A_I2C_TIMEOUT);
i2c_write_register(addr << 1, i + 1, g_pwm_buffer[index] + i, 18, IS31FL3743A_I2C_TIMEOUT);
#endif
}
}
@ -196,7 +196,7 @@ void is31fl3743a_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3743a_select_page(addr, IS31FL3743A_COMMAND_PWM);
is31fl3743a_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3743a_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -87,7 +87,6 @@ void is31fl3743a_init_drivers(void);
void is31fl3743a_init(uint8_t addr, uint8_t sync);
void is31fl3743a_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3743a_select_page(uint8_t addr, uint8_t page);
void is31fl3743a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3743a_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void is31fl3743a_set_color_all(uint8_t red, uint8_t green, uint8_t blue);

View File

@ -71,10 +71,10 @@ uint8_t g_scaling_registers[IS31FL3745_DRIVER_COUNT][IS31FL3745_SCALING_REGISTER
void is31fl3745_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3745_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3745_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3745_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3745_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3745_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3745_I2C_TIMEOUT);
#endif
}
@ -83,7 +83,7 @@ void is31fl3745_select_page(uint8_t addr, uint8_t page) {
is31fl3745_write_register(addr, IS31FL3745_REG_COMMAND, page);
}
void is31fl3745_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3745_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 0 is already selected.
// Transmit PWM registers in 8 transfers of 18 bytes.
@ -91,10 +91,10 @@ void is31fl3745_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3745_PWM_REGISTER_COUNT; i += 18) {
#if IS31FL3745_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3745_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i + 1, pwm_buffer + i, 18, IS31FL3745_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i + 1, g_pwm_buffer[index] + i, 18, IS31FL3745_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i + 1, pwm_buffer + i, 18, IS31FL3745_I2C_TIMEOUT);
i2c_write_register(addr << 1, i + 1, g_pwm_buffer[index] + i, 18, IS31FL3745_I2C_TIMEOUT);
#endif
}
}
@ -192,7 +192,7 @@ void is31fl3745_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3745_select_page(addr, IS31FL3745_COMMAND_PWM);
is31fl3745_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3745_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -85,7 +85,6 @@ void is31fl3745_init_drivers(void);
void is31fl3745_init(uint8_t addr, uint8_t sync);
void is31fl3745_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3745_select_page(uint8_t addr, uint8_t page);
void is31fl3745_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3745_set_value(int index, uint8_t value);
void is31fl3745_set_value_all(uint8_t value);

View File

@ -71,10 +71,10 @@ uint8_t g_scaling_registers[IS31FL3745_DRIVER_COUNT][IS31FL3745_SCALING_REGISTER
void is31fl3745_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3745_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3745_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3745_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3745_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3745_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3745_I2C_TIMEOUT);
#endif
}
@ -83,7 +83,7 @@ void is31fl3745_select_page(uint8_t addr, uint8_t page) {
is31fl3745_write_register(addr, IS31FL3745_REG_COMMAND, page);
}
void is31fl3745_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3745_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 0 is already selected.
// Transmit PWM registers in 8 transfers of 18 bytes.
@ -91,10 +91,10 @@ void is31fl3745_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3745_PWM_REGISTER_COUNT; i += 18) {
#if IS31FL3745_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3745_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i + 1, pwm_buffer + i, 18, IS31FL3745_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i + 1, g_pwm_buffer[index] + i, 18, IS31FL3745_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i + 1, pwm_buffer + i, 18, IS31FL3745_I2C_TIMEOUT);
i2c_write_register(addr << 1, i + 1, g_pwm_buffer[index] + i, 18, IS31FL3745_I2C_TIMEOUT);
#endif
}
}
@ -196,7 +196,7 @@ void is31fl3745_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3745_select_page(addr, IS31FL3745_COMMAND_PWM);
is31fl3745_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3745_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -87,7 +87,6 @@ void is31fl3745_init_drivers(void);
void is31fl3745_init(uint8_t addr, uint8_t sync);
void is31fl3745_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3745_select_page(uint8_t addr, uint8_t page);
void is31fl3745_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3745_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void is31fl3745_set_color_all(uint8_t red, uint8_t green, uint8_t blue);

View File

@ -62,10 +62,10 @@ uint8_t g_scaling_registers[IS31FL3746A_DRIVER_COUNT][IS31FL3746A_SCALING_REGIST
void is31fl3746a_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3746A_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3746A_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3746A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3746A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3746A_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3746A_I2C_TIMEOUT);
#endif
}
@ -74,7 +74,7 @@ void is31fl3746a_select_page(uint8_t addr, uint8_t page) {
is31fl3746a_write_register(addr, IS31FL3746A_REG_COMMAND, page);
}
void is31fl3746a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3746a_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 0 is already selected.
// Transmit PWM registers in 4 transfers of 18 bytes.
@ -82,10 +82,10 @@ void is31fl3746a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3746A_PWM_REGISTER_COUNT; i += 18) {
#if IS31FL3746A_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3746A_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i + 1, pwm_buffer + i, 18, IS31FL3746A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i + 1, g_pwm_buffer[index] + i, 18, IS31FL3746A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i + 1, pwm_buffer + i, 18, IS31FL3746A_I2C_TIMEOUT);
i2c_write_register(addr << 1, i + 1, g_pwm_buffer[index] + i, 18, IS31FL3746A_I2C_TIMEOUT);
#endif
}
}
@ -184,7 +184,7 @@ void is31fl3746a_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3746a_select_page(addr, IS31FL3746A_COMMAND_PWM);
is31fl3746a_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3746a_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -87,7 +87,6 @@ void is31fl3746a_init_drivers(void);
void is31fl3746a_init(uint8_t addr);
void is31fl3746a_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3746a_select_page(uint8_t addr, uint8_t page);
void is31fl3746a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3746a_set_value(int index, uint8_t value);
void is31fl3746a_set_value_all(uint8_t value);

View File

@ -62,10 +62,10 @@ uint8_t g_scaling_registers[IS31FL3746A_DRIVER_COUNT][IS31FL3746A_SCALING_REGIST
void is31fl3746a_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3746A_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3746A_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3746A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, IS31FL3746A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, IS31FL3746A_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, IS31FL3746A_I2C_TIMEOUT);
#endif
}
@ -74,7 +74,7 @@ void is31fl3746a_select_page(uint8_t addr, uint8_t page) {
is31fl3746a_write_register(addr, IS31FL3746A_REG_COMMAND, page);
}
void is31fl3746a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3746a_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 0 is already selected.
// Transmit PWM registers in 4 transfers of 18 bytes.
@ -82,10 +82,10 @@ void is31fl3746a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < IS31FL3746A_PWM_REGISTER_COUNT; i += 18) {
#if IS31FL3746A_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < IS31FL3746A_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i + 1, pwm_buffer + i, 18, IS31FL3746A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i + 1, g_pwm_buffer[index] + i, 18, IS31FL3746A_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i + 1, pwm_buffer + i, 18, IS31FL3746A_I2C_TIMEOUT);
i2c_write_register(addr << 1, i + 1, g_pwm_buffer[index] + i, 18, IS31FL3746A_I2C_TIMEOUT);
#endif
}
}
@ -188,7 +188,7 @@ void is31fl3746a_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3746a_select_page(addr, IS31FL3746A_COMMAND_PWM);
is31fl3746a_write_pwm_buffer(addr, g_pwm_buffer[index]);
is31fl3746a_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -89,7 +89,6 @@ void is31fl3746a_init_drivers(void);
void is31fl3746a_init(uint8_t addr);
void is31fl3746a_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3746a_select_page(uint8_t addr, uint8_t page);
void is31fl3746a_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void is31fl3746a_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void is31fl3746a_set_color_all(uint8_t red, uint8_t green, uint8_t blue);

View File

@ -52,10 +52,10 @@ bool g_led_control_registers_update_required[SNLED27351_DRIVER_COUNT]
void snled27351_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if SNLED27351_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < SNLED27351_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, SNLED27351_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, SNLED27351_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, SNLED27351_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, SNLED27351_I2C_TIMEOUT);
#endif
}
@ -63,7 +63,7 @@ void snled27351_select_page(uint8_t addr, uint8_t page) {
snled27351_write_register(addr, SNLED27351_REG_COMMAND, page);
}
void snled27351_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void snled27351_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes PG1 is already selected.
// Transmit PWM registers in 12 transfers of 16 bytes.
@ -71,10 +71,10 @@ void snled27351_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < SNLED27351_PWM_REGISTER_COUNT; i += 16) {
#if SNLED27351_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < SNLED27351_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, SNLED27351_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, SNLED27351_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, SNLED27351_I2C_TIMEOUT);
i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, SNLED27351_I2C_TIMEOUT);
#endif
}
}
@ -196,7 +196,7 @@ void snled27351_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
snled27351_select_page(addr, SNLED27351_COMMAND_PWM);
snled27351_write_pwm_buffer(addr, g_pwm_buffer[index]);
snled27351_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -157,7 +157,6 @@ void snled27351_init_drivers(void);
void snled27351_init(uint8_t addr);
void snled27351_select_page(uint8_t addr, uint8_t page);
void snled27351_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void snled27351_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void snled27351_set_value(int index, uint8_t value);
void snled27351_set_value_all(uint8_t value);

View File

@ -52,10 +52,10 @@ bool g_led_control_registers_update_required[SNLED27351_DRIVER_COUNT]
void snled27351_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
#if SNLED27351_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < SNLED27351_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(addr << 1, reg, &data, 1, SNLED27351_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, reg, &data, 1, SNLED27351_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, reg, &data, 1, SNLED27351_I2C_TIMEOUT);
i2c_write_register(addr << 1, reg, &data, 1, SNLED27351_I2C_TIMEOUT);
#endif
}
@ -63,7 +63,7 @@ void snled27351_select_page(uint8_t addr, uint8_t page) {
snled27351_write_register(addr, SNLED27351_REG_COMMAND, page);
}
void snled27351_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
void snled27351_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes PG1 is already selected.
// Transmit PWM registers in 12 transfers of 16 bytes.
@ -71,10 +71,10 @@ void snled27351_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
for (uint8_t i = 0; i < SNLED27351_PWM_REGISTER_COUNT; i += 16) {
#if SNLED27351_I2C_PERSISTENCE > 0
for (uint8_t j = 0; j < SNLED27351_I2C_PERSISTENCE; j++) {
if (i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, SNLED27351_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
if (i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, SNLED27351_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(addr << 1, i, pwm_buffer + i, 16, SNLED27351_I2C_TIMEOUT);
i2c_write_register(addr << 1, i, g_pwm_buffer[index] + i, 16, SNLED27351_I2C_TIMEOUT);
#endif
}
}
@ -212,7 +212,7 @@ void snled27351_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
snled27351_select_page(addr, SNLED27351_COMMAND_PWM);
snled27351_write_pwm_buffer(addr, g_pwm_buffer[index]);
snled27351_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -171,7 +171,6 @@ void snled27351_init_drivers(void);
void snled27351_init(uint8_t addr);
void snled27351_select_page(uint8_t addr, uint8_t page);
void snled27351_write_register(uint8_t addr, uint8_t reg, uint8_t data);
void snled27351_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
void snled27351_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void snled27351_set_color_all(uint8_t red, uint8_t green, uint8_t blue);

View File

@ -108,7 +108,6 @@ static struct {
i2c_status_t azoteq_iqs5xx_wake(void) {
uint8_t data = 0;
i2c_status_t status = i2c_read_register16(AZOTEQ_IQS5XX_ADDRESS, AZOTEQ_IQS5XX_REG_PREVIOUS_CYCLE_TIME, (uint8_t *)&data, sizeof(data), 1);
i2c_stop();
wait_us(150);
return status;
}

View File

@ -218,9 +218,16 @@ void cirque_pinnacle_cursor_smoothing(bool enable) {
// Check sensor is connected
bool cirque_pinnacle_connected(void) {
uint8_t zidle = 0;
RAP_ReadBytes(HOSTREG__ZIDLE, &zidle, 1);
return zidle == HOSTREG__ZIDLE_DEFVAL;
uint8_t current_zidle = 0;
uint8_t temp_zidle = 0;
RAP_ReadBytes(HOSTREG__ZIDLE, &current_zidle, 1);
RAP_Write(HOSTREG__ZIDLE, HOSTREG__ZIDLE_DEFVAL);
RAP_ReadBytes(HOSTREG__ZIDLE, &temp_zidle, 1);
if (temp_zidle == HOSTREG__ZIDLE_DEFVAL) {
RAP_Write(HOSTREG__ZIDLE, current_zidle);
return true;
}
return false;
}
/* Pinnacle-based TM040040/TM035035/TM023023 Functions */

View File

@ -76,7 +76,7 @@ uint8_t matrix_scan(void)
if (matrix_debouncing[i] != cols) {
matrix_debouncing[i] = cols;
if (debouncing) {
debug("bounce!: "); debug_hex(debouncing); debug("\n");
dprintf("bounce!: %02X\n", debouncing);
}
debouncing = DEBOUNCE;
}

View File

@ -88,7 +88,7 @@ uint8_t matrix_scan(void)
if (matrix_debouncing[i] != cols) {
matrix_debouncing[i] = cols;
if (debouncing) {
debug("bounce!: "); debug_hex(debouncing); debug("\n");
dprintf("bounce!: %02X\n", debouncing);
}
debouncing = DEBOUNCE;
}

View File

@ -59,9 +59,7 @@ static void bluefruit_trace_footer(void)
static void bluefruit_serial_send(uint8_t data)
{
#ifdef BLUEFRUIT_TRACE_SERIAL
dprintf(" ");
debug_hex8(data);
dprintf(" ");
dprintf(" %02X ", data);
#endif
serial_send(data);
}
@ -146,11 +144,7 @@ void bluetooth_send_consumer(uint16_t usage)
uint16_t bitmap = CONSUMER2BLUEFRUIT(usage);
#ifdef BLUEFRUIT_TRACE_SERIAL
dprintf("\nData: ");
debug_hex16(data);
dprintf("; bitmap: ");
debug_hex16(bitmap);
dprintf("\n");
dprintf("\nData: %04X; bitmap: %04X\n", data, bitmap);
bluefruit_trace_header();
#endif
send_str(PSTR("AT+BLEHIDCONTROLKEY=0x"));

View File

@ -87,23 +87,23 @@ uint8_t matrix_scan(void)
uint8_t code;
if ((code = ps2_host_recv())) {
debug("r"); debug_hex(code); debug(" ");
dprintf("r%02X ", code);
}
switch (state) {
case RESET:
debug("wFF ");
dprint("wFF ");
if (ps2_host_send(0xFF) == 0xFA) {
debug("[ack]\nRESET_RESPONSE: ");
dprint("[ack]\nRESET_RESPONSE: ");
state = RESET_RESPONSE;
}
break;
case RESET_RESPONSE:
if (code == 0xAA) {
debug("[ok]\nKBD_ID: ");
dprint("[ok]\nKBD_ID: ");
state = KBD_ID0;
} else if (code) {
debug("err\nRESET: ");
dprint("err\nRESET: ");
state = RESET;
}
break;
@ -115,14 +115,14 @@ uint8_t matrix_scan(void)
break;
case KBD_ID1:
if (code) {
debug("\nCONFIG: ");
dprint("\nCONFIG: ");
state = CONFIG;
}
break;
case CONFIG:
debug("wF8 ");
dprint("wF8 ");
if (ps2_host_send(0xF8) == 0xFA) {
debug("[ack]\nREADY\n");
dprint("[ack]\nREADY\n");
state = READY;
}
break;
@ -132,16 +132,16 @@ uint8_t matrix_scan(void)
break;
case 0xF0:
state = F0_BREAK;
debug(" ");
dprint(" ");
break;
default: // normal key make
if (code < 0x88) {
matrix_make(code);
} else {
debug("unexpected scan code at READY: "); debug_hex(code); debug("\n");
dprintf("unexpected scan code at READY: %02X\n", code);
}
state = READY;
debug("\n");
dprint("\n");
}
break;
case F0_BREAK: // Break code
@ -152,10 +152,10 @@ uint8_t matrix_scan(void)
if (code < 0x88) {
matrix_break(code);
} else {
debug("unexpected scan code at F0: "); debug_hex(code); debug("\n");
dprintf("unexpected scan code at F0: %02X\n", code);
}
state = READY;
debug("\n");
dprint("\n");
}
break;
}

View File

@ -312,8 +312,7 @@ static inline uint8_t instant(void) {
m0110_send(M0110_INSTANT);
uint8_t data = m0110_recv();
if (data != M0110_NULL) {
debug_hex(data);
debug(" ");
dprintf("%02X ", data);
}
return data;
}

View File

@ -168,7 +168,7 @@ uint8_t get_serial_byte(void) {
while(1) {
code = uart_read();
if (code) {
debug_hex(code); debug(" ");
dprintf("%02X ", code);
return code;
}
}
@ -316,8 +316,7 @@ uint8_t matrix_scan(void)
last_activity = timer_read();
disconnect_counter=0; // if we are getting serial data, we're connected.
debug_hex(code); debug(" ");
dprintf("%02X ", code);
switch (code) {
case 0xFD: // unexpected reset byte 2

View File

@ -111,7 +111,7 @@ uint8_t matrix_scan(void)
code = uart_read();
if (!code) return 0;
debug_hex(code); debug(" ");
dprintf("%02X ", code);
switch (code) {
case 0xFF: // reset success: FF 04

View File

@ -18,7 +18,6 @@
/* joystick configuration */
#define JOYSTICK_BUTTON_COUNT 25
#define JOYSTICK_AXIS_COUNT 2
#define JOYSTICK_AXIS_RESOLUTION 10
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */

View File

@ -151,7 +151,7 @@ uint8_t matrix_scan(void)
if (matrix_debouncing[i] != cols) {
matrix_debouncing[i] = cols;
if (debouncing) {
debug("bounce!: "); debug_hex(debouncing); debug("\n");
dprintf("bounce!: %02X\n", debouncing);
}
debouncing = DEBOUNCE;
}

View File

@ -1,4 +1,3 @@
#pragma once
#define JOYSTICK_AXIS_COUNT 2
#define JOYSTICK_BUTTON_COUNT 1

View File

@ -60,8 +60,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
row_data = spi_read() << 8;
row_data |= spi_read();
debug_hex8(~row_data);
dprint(" ");
dprintf("%02X ", ~row_data);
// For each row...
for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) {

View File

@ -114,7 +114,7 @@ i2c_status_t i2c_receive(uint8_t index, uint8_t address, uint8_t* data, uint16_t
return chibios_to_qmk(&status);
}
i2c_status_t i2c_writeReg(uint8_t index, uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) {
i2c_status_t i2c_write_register(uint8_t index, uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) {
if(index >= I2C_COUNT) {
return I2C_STATUS_ERROR;
}
@ -131,7 +131,7 @@ i2c_status_t i2c_writeReg(uint8_t index, uint8_t devaddr, uint8_t regaddr, const
return chibios_to_qmk(&status);
}
i2c_status_t i2c_readReg(uint8_t index, uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) {
i2c_status_t i2c_read_register(uint8_t index, uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) {
if(index >= I2C_COUNT) {
return I2C_STATUS_ERROR;
}

View File

@ -123,6 +123,6 @@ void i2c_init(I2CDriver *driver, ioline_t scl_pin, ioline_t sda_pin);
i2c_status_t i2c_start(uint8_t index, uint8_t address);
i2c_status_t i2c_transmit(uint8_t index, uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout);
i2c_status_t i2c_receive(uint8_t index, uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);
i2c_status_t i2c_writeReg(uint8_t index, uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout);
i2c_status_t i2c_readReg(uint8_t index, uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
i2c_status_t i2c_write_register(uint8_t index, uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout);
i2c_status_t i2c_read_register(uint8_t index, uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
void i2c_stop(uint8_t index);

View File

@ -75,10 +75,10 @@ bool g_led_control_registers_update_required[IS31FL3733_DRIVER_COUNT]
void is31fl3733_write_register(uint8_t index, uint8_t addr, uint8_t reg, uint8_t data) {
#if IS31FL3733_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3733_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(index, addr << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT) == 0) break;
if (i2c_write_register(index, addr << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(index, addr << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT);
i2c_write_register(index, addr << 1, reg, &data, 1, IS31FL3733_I2C_TIMEOUT);
#endif
}
@ -87,18 +87,18 @@ void is31fl3733_select_page(uint8_t index, uint8_t addr, uint8_t page) {
is31fl3733_write_register(index, addr, IS31FL3733_REG_COMMAND, page);
}
void is31fl3733_write_pwm_buffer(uint8_t index, uint8_t addr, uint8_t *pwm_buffer) {
void is31fl3733_write_pwm_buffer(uint8_t addr, uint8_t index) {
// Assumes page 1 is already selected.
// Transmit PWM registers in 12 transfers of 16 bytes.
// Iterate over the pwm_buffer contents at 16 byte intervals.
for (int i = 0; i < IS31FL3733_PWM_REGISTER_COUNT; i += 16) {
for (uint8_t i = 0; i < IS31FL3733_PWM_REGISTER_COUNT; i += 16) {
#if IS31FL3733_I2C_PERSISTENCE > 0
for (uint8_t i = 0; i < IS31FL3733_I2C_PERSISTENCE; i++) {
if (i2c_writeReg(index, addr << 1, i, pwm_buffer + i, 16, IS31FL3733_I2C_TIMEOUT) == 0) break;
for (uint8_t j = 0; j < IS31FL3733_I2C_PERSISTENCE; j++) {
if (i2c_write_register(index, addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3733_I2C_TIMEOUT) == I2C_STATUS_SUCCESS) break;
}
#else
i2c_writeReg(index, addr << 1, i, pwm_buffer + i, 16, IS31FL3733_I2C_TIMEOUT);
i2c_write_register(index, addr << 1, i, g_pwm_buffer[index] + i, 16, IS31FL3733_I2C_TIMEOUT);
#endif
}
}
@ -216,7 +216,7 @@ void is31fl3733_update_pwm_buffers(uint8_t addr, uint8_t index) {
if (g_pwm_buffer_update_required[index]) {
is31fl3733_select_page(index, addr, IS31FL3733_COMMAND_PWM);
is31fl3733_write_pwm_buffer(index, addr, g_pwm_buffer[index]);
is31fl3733_write_pwm_buffer(addr, index);
g_pwm_buffer_update_required[index] = false;
}

View File

@ -86,7 +86,6 @@ void is31fl3733_init_drivers(void);
void is31fl3733_init(uint8_t bus, uint8_t addr, uint8_t sync);
void is31fl3733_write_register(uint8_t index, uint8_t addr, uint8_t reg, uint8_t data);
void is31fl3733_select_page(uint8_t index, uint8_t addr, uint8_t page);
void is31fl3733_write_pwm_buffer(uint8_t index, uint8_t addr, uint8_t *pwm_buffer);
void is31fl3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
void is31fl3733_set_color_all(uint8_t red, uint8_t green, uint8_t blue);

View File

@ -116,7 +116,7 @@ uint8_t matrix_scan(void)
if (matrix_debouncing[i] != row) {
matrix_debouncing[i] = row;
if (debouncing) {
debug("bounce!: "); debug_hex(debouncing); debug("\n");
dprintf("bounce!: %02X\n", debouncing);
}
debouncing = DEBOUNCE;
}

View File

@ -13,6 +13,11 @@
"nkro": true,
"rgb_matrix": true
},
"indicators": {
"caps_lock": "A2",
"num_lock": "A3",
"scroll_lock": "A1"
},
"matrix_pins": {
"cols": ["B10", "A8", "A7", "B15", "A6", "B14", "A4", "C15", "B9", "C14", "B8", "C13", "B7", "B6", "B5", "B3", "B4", "A15"],
"rows": ["B12", "B13", "A5", "B0", "B1"]

View File

@ -16,11 +16,6 @@
#pragma once
/* joystick support */
#ifdef JOYSTICK_ENABLE
# define JOYSTICK_AXIS_COUNT 2
# define JOYSTICK_BUTTON_COUNT 1
# define JOYSTICK_AXIS_RESOLUTION 8
#endif
#define JOYSTICK_BUTTON_COUNT 1
#define SPLIT_USB_DETECT

View File

@ -23,42 +23,42 @@
"center_point": [133, 54],
"driver": "ws2812",
"layout": [
{ "flags": 4, "matrix": [3, 4], "x": 122, "y": 85 },
{ "flags": 4, "matrix": [3, 3], "x": 102, "y": 85 },
{ "flags": 4, "matrix": [3, 2], "x": 81, "y": 85 },
{ "flags": 4, "matrix": [2, 4], "x": 102, "y": 64 },
{ "flags": 4, "matrix": [1, 4], "x": 102, "y": 43 },
{ "flags": 4, "matrix": [0, 4], "x": 102, "y": 21 },
{ "flags": 4, "matrix": [0, 3], "x": 81, "y": 21 },
{ "flags": 4, "matrix": [1, 3], "x": 81, "y": 43 },
{ "flags": 4, "matrix": [2, 3], "x": 81, "y": 64 },
{ "flags": 4, "matrix": [2, 2], "x": 61, "y": 64 },
{ "flags": 4, "matrix": [1, 2], "x": 61, "y": 43 },
{ "flags": 4, "matrix": [0, 2], "x": 61, "y": 21 },
{ "flags": 4, "matrix": [0, 1], "x": 41, "y": 21 },
{ "flags": 4, "matrix": [1, 1], "x": 41, "y": 43 },
{ "flags": 4, "matrix": [2, 1], "x": 41, "y": 64 },
{ "flags": 4, "matrix": [2, 0], "x": 20, "y": 64 },
{ "flags": 4, "matrix": [1, 0], "x": 20, "y": 43 },
{ "flags": 4, "matrix": [0, 0], "x": 20, "y": 21 },
{ "flags": 4, "matrix": [7, 0], "x": 143, "y": 85 },
{ "flags": 4, "matrix": [7, 1], "x": 163, "y": 85 },
{ "flags": 4, "matrix": [7, 2], "x": 183, "y": 85 },
{ "flags": 4, "matrix": [6, 0], "x": 163, "y": 64 },
{ "flags": 4, "matrix": [5, 0], "x": 163, "y": 43 },
{ "flags": 4, "matrix": [4, 0], "x": 163, "y": 21 },
{ "flags": 4, "matrix": [4, 1], "x": 183, "y": 21 },
{ "flags": 4, "matrix": [5, 1], "x": 183, "y": 43 },
{ "flags": 4, "matrix": [6, 1], "x": 183, "y": 64 },
{ "flags": 4, "matrix": [6, 2], "x": 204, "y": 64 },
{ "flags": 4, "matrix": [5, 2], "x": 204, "y": 43 },
{ "flags": 4, "matrix": [4, 2], "x": 204, "y": 21 },
{ "flags": 4, "matrix": [4, 3], "x": 224, "y": 21 },
{ "flags": 4, "matrix": [5, 3], "x": 224, "y": 43 },
{ "flags": 4, "matrix": [6, 3], "x": 224, "y": 64 },
{ "flags": 4, "matrix": [6, 4], "x": 244, "y": 64 },
{ "flags": 4, "matrix": [5, 4], "x": 244, "y": 43 },
{ "flags": 4, "matrix": [4, 4], "x": 244, "y": 21 }
{"matrix": [3, 4], "x": 122, "y": 85, "flags": 4},
{"matrix": [3, 3], "x": 102, "y": 85, "flags": 4},
{"matrix": [3, 2], "x": 81, "y": 85, "flags": 4},
{"matrix": [2, 4], "x": 102, "y": 64, "flags": 4},
{"matrix": [1, 4], "x": 102, "y": 43, "flags": 4},
{"matrix": [0, 4], "x": 102, "y": 21, "flags": 4},
{"matrix": [0, 3], "x": 81, "y": 21, "flags": 4},
{"matrix": [1, 3], "x": 81, "y": 43, "flags": 4},
{"matrix": [2, 3], "x": 81, "y": 64, "flags": 4},
{"matrix": [2, 2], "x": 61, "y": 64, "flags": 4},
{"matrix": [1, 2], "x": 61, "y": 43, "flags": 4},
{"matrix": [0, 2], "x": 61, "y": 21, "flags": 4},
{"matrix": [0, 1], "x": 41, "y": 21, "flags": 4},
{"matrix": [1, 1], "x": 41, "y": 43, "flags": 4},
{"matrix": [2, 1], "x": 41, "y": 64, "flags": 4},
{"matrix": [2, 0], "x": 20, "y": 64, "flags": 4},
{"matrix": [1, 0], "x": 20, "y": 43, "flags": 4},
{"matrix": [0, 0], "x": 20, "y": 21, "flags": 4},
{"matrix": [7, 0], "x": 143, "y": 85, "flags": 4},
{"matrix": [7, 1], "x": 163, "y": 85, "flags": 4},
{"matrix": [7, 2], "x": 183, "y": 85, "flags": 4},
{"matrix": [6, 0], "x": 163, "y": 64, "flags": 4},
{"matrix": [5, 0], "x": 163, "y": 43, "flags": 4},
{"matrix": [4, 0], "x": 163, "y": 21, "flags": 4},
{"matrix": [4, 1], "x": 183, "y": 21, "flags": 4},
{"matrix": [5, 1], "x": 183, "y": 43, "flags": 4},
{"matrix": [6, 1], "x": 183, "y": 64, "flags": 4},
{"matrix": [6, 2], "x": 204, "y": 64, "flags": 4},
{"matrix": [5, 2], "x": 204, "y": 43, "flags": 4},
{"matrix": [4, 2], "x": 204, "y": 21, "flags": 4},
{"matrix": [4, 3], "x": 224, "y": 21, "flags": 4},
{"matrix": [5, 3], "x": 224, "y": 43, "flags": 4},
{"matrix": [6, 3], "x": 224, "y": 64, "flags": 4},
{"matrix": [6, 4], "x": 244, "y": 64, "flags": 4},
{"matrix": [5, 4], "x": 244, "y": 43, "flags": 4},
{"matrix": [4, 4], "x": 244, "y": 21, "flags": 4}
],
"split_count": [18, 18]
},
@ -76,45 +76,46 @@
"driver": "vendor",
"pin": "GP29"
},
"community_layouts": ["split_3x5_3"],
"layouts": {
"LAYOUT_split_3x5_3": {
"layout": [
{ "label": "L00", "matrix": [0, 0], "w": 1, "x": 0, "y": 0 },
{ "label": "L01", "matrix": [0, 1], "w": 1, "x": 1, "y": 0 },
{ "label": "L02", "matrix": [0, 2], "w": 1, "x": 2, "y": 0 },
{ "label": "L03", "matrix": [0, 3], "w": 1, "x": 3, "y": 0 },
{ "label": "L04", "matrix": [0, 4], "w": 1, "x": 4, "y": 0 },
{ "label": "R00", "matrix": [4, 4], "w": 1, "x": 5, "y": 0 },
{ "label": "R01", "matrix": [4, 3], "w": 1, "x": 6, "y": 0 },
{ "label": "R02", "matrix": [4, 2], "w": 1, "x": 7, "y": 0 },
{ "label": "R03", "matrix": [4, 1], "w": 1, "x": 8, "y": 0 },
{ "label": "R04", "matrix": [4, 0], "w": 1, "x": 9, "y": 0 },
{ "label": "L10", "matrix": [1, 0], "w": 1, "x": 10, "y": 0 },
{ "label": "L11", "matrix": [1, 1], "w": 1, "x": 11, "y": 0 },
{ "label": "L12", "matrix": [1, 2], "w": 1, "x": 12, "y": 0 },
{ "label": "L13", "matrix": [1, 3], "w": 1, "x": 13, "y": 0 },
{ "label": "L14", "matrix": [1, 4], "w": 1, "x": 14, "y": 0 },
{ "label": "R10", "matrix": [5, 4], "w": 1, "x": 15, "y": 0 },
{ "label": "R11", "matrix": [5, 3], "w": 1, "x": 16, "y": 0 },
{ "label": "R12", "matrix": [5, 2], "w": 1, "x": 17, "y": 0 },
{ "label": "R13", "matrix": [5, 1], "w": 1, "x": 18, "y": 0 },
{ "label": "R14", "matrix": [5, 0], "w": 1, "x": 19, "y": 0 },
{ "label": "L20", "matrix": [2, 0], "w": 1, "x": 20, "y": 0 },
{ "label": "L21", "matrix": [2, 1], "w": 1, "x": 21, "y": 0 },
{ "label": "L22", "matrix": [2, 2], "w": 1, "x": 22, "y": 0 },
{ "label": "L23", "matrix": [2, 3], "w": 1, "x": 23, "y": 0 },
{ "label": "L24", "matrix": [2, 4], "w": 1, "x": 24, "y": 0 },
{ "label": "R20", "matrix": [6, 4], "w": 1, "x": 25, "y": 0 },
{ "label": "R21", "matrix": [6, 3], "w": 1, "x": 26, "y": 0 },
{ "label": "R22", "matrix": [6, 2], "w": 1, "x": 27, "y": 0 },
{ "label": "R23", "matrix": [6, 1], "w": 1, "x": 28, "y": 0 },
{ "label": "R24", "matrix": [6, 0], "w": 1, "x": 29, "y": 0 },
{ "label": "L32", "matrix": [3, 2], "w": 1, "x": 30, "y": 0 },
{ "label": "L33", "matrix": [3, 3], "w": 1, "x": 31, "y": 0 },
{ "label": "L34", "matrix": [3, 4], "w": 1, "x": 32, "y": 0 },
{ "label": "R30", "matrix": [7, 4], "w": 1, "x": 33, "y": 0 },
{ "label": "R31", "matrix": [7, 3], "w": 1, "x": 34, "y": 0 },
{ "label": "R32", "matrix": [7, 2], "w": 1, "x": 35, "y": 0 }
{"label": "L00", "matrix": [0, 0], "x": 0, "y": 1.25},
{"label": "L01", "matrix": [0, 1], "x": 1, "y": 0.25},
{"label": "L02", "matrix": [0, 2], "x": 2, "y": 0},
{"label": "L03", "matrix": [0, 3], "x": 3, "y": 0.5},
{"label": "L04", "matrix": [0, 4], "x": 4, "y": 0.65},
{"label": "R00", "matrix": [4, 4], "x": 7, "y": 0.65},
{"label": "R01", "matrix": [4, 3], "x": 8, "y": 0.5},
{"label": "R02", "matrix": [4, 2], "x": 9, "y": 0},
{"label": "R03", "matrix": [4, 1], "x": 10, "y": 0.25},
{"label": "R04", "matrix": [4, 0], "x": 11, "y": 1.25},
{"label": "L10", "matrix": [1, 0], "x": 0, "y": 2.25},
{"label": "L11", "matrix": [1, 1], "x": 1, "y": 1.25},
{"label": "L12", "matrix": [1, 2], "x": 2, "y": 1},
{"label": "L13", "matrix": [1, 3], "x": 3, "y": 1.5},
{"label": "L14", "matrix": [1, 4], "x": 4, "y": 1.65},
{"label": "R10", "matrix": [5, 4], "x": 7, "y": 1.65},
{"label": "R11", "matrix": [5, 3], "x": 8, "y": 1.5},
{"label": "R12", "matrix": [5, 2], "x": 9, "y": 1},
{"label": "R13", "matrix": [5, 1], "x": 10, "y": 1.25},
{"label": "R14", "matrix": [5, 0], "x": 11, "y": 2.25},
{"label": "L20", "matrix": [2, 0], "x": 0, "y": 3.25},
{"label": "L21", "matrix": [2, 1], "x": 1, "y": 2.25},
{"label": "L22", "matrix": [2, 2], "x": 2, "y": 2},
{"label": "L23", "matrix": [2, 3], "x": 3, "y": 2.5},
{"label": "L24", "matrix": [2, 4], "x": 4, "y": 2.65},
{"label": "R20", "matrix": [6, 4], "x": 7, "y": 2.65},
{"label": "R21", "matrix": [6, 3], "x": 8, "y": 2.5},
{"label": "R22", "matrix": [6, 2], "x": 9, "y": 2},
{"label": "R23", "matrix": [6, 1], "x": 10, "y": 2.25},
{"label": "R24", "matrix": [6, 0], "x": 11, "y": 3.25},
{"label": "L32", "matrix": [3, 2], "x": 2.5, "y": 3.65},
{"label": "L33", "matrix": [3, 3], "x": 3.5, "y": 3.75},
{"label": "L34", "matrix": [3, 4], "x": 4.5, "y": 4.15},
{"label": "R30", "matrix": [7, 4], "x": 6.5, "y": 4.15},
{"label": "R31", "matrix": [7, 3], "x": 7.5, "y": 3.75},
{"label": "R32", "matrix": [7, 2], "x": 8.5, "y": 3.65}
]
}
}

View File

@ -17,7 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_H
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

View File

@ -85,7 +85,7 @@ int main(void)
_delay_ms(1000);
}
debug("init: done\n");
dprintln("init: done");
for (;;) {
keyboard_task();

117
keyboards/sofle/info.json Normal file
View File

@ -0,0 +1,117 @@
{
"keyboard_name": "Sofle",
"features": {
"bootmagic": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"encoder": true,
"oled": true
},
"build": {
"lto": true
},
"usb": {
"vid": "0xFC32"
},
"diode_direction": "COL2ROW",
"qmk": {
"tap_keycode_delay": 10
},
"split": {
"enabled": true,
"soft_serial_pin": "D2",
"transport": {
"sync": {
"matrix_state": true
}
}
},
"ws2812": {
"pin": "D3"
},
"rgblight": {
"led_count": 72,
"split_count": [36, 36],
"sleep": true
},
"rgb_matrix": {
"driver": "ws2812",
"split_count": [36, 36],
"sleep": true,
"layout": [
{"x": 96, "y": 40, "flags": 8},
{"x": 16, "y": 20, "flags": 2},
{"x": 48, "y": 10, "flags": 2},
{"x": 80, "y": 18, "flags": 2},
{"x": 88, "y": 60, "flags": 2},
{"x": 56, "y": 57, "flags": 2},
{"x": 24, "y": 60, "flags": 2},
{"matrix": [4, 0], "x": 32, "y": 57, "flags": 4},
{"matrix": [3, 0], "x": 0, "y": 48, "flags": 4},
{"matrix": [2, 0], "x": 0, "y": 36, "flags": 4},
{"matrix": [1, 0], "x": 0, "y": 24, "flags": 4},
{"matrix": [0, 0], "x": 0, "y": 12, "flags": 4},
{"matrix": [0, 1], "x": 16, "y": 12, "flags": 4},
{"matrix": [1, 1], "x": 16, "y": 24, "flags": 4},
{"matrix": [2, 1], "x": 16, "y": 36, "flags": 4},
{"matrix": [3, 1], "x": 16, "y": 48, "flags": 4},
{"matrix": [4, 1], "x": 48, "y": 55, "flags": 4},
{"matrix": [4, 2], "x": 64, "y": 57, "flags": 4},
{"matrix": [3, 2], "x": 32, "y": 45, "flags": 4},
{"matrix": [2, 2], "x": 32, "y": 33, "flags": 4},
{"matrix": [1, 2], "x": 32, "y": 21, "flags": 4},
{"matrix": [0, 2], "x": 32, "y": 9, "flags": 4},
{"matrix": [0, 3], "x": 48, "y": 7, "flags": 4},
{"matrix": [1, 3], "x": 48, "y": 19, "flags": 4},
{"matrix": [2, 3], "x": 48, "y": 31, "flags": 4},
{"matrix": [3, 3], "x": 48, "y": 43, "flags": 4},
{"matrix": [4, 3], "x": 80, "y": 59, "flags": 4},
{"matrix": [4, 4], "x": 96, "y": 64, "flags": 4},
{"matrix": [3, 4], "x": 64, "y": 45, "flags": 4},
{"matrix": [2, 4], "x": 64, "y": 33, "flags": 4},
{"matrix": [1, 4], "x": 64, "y": 21, "flags": 4},
{"matrix": [0, 4], "x": 64, "y": 9, "flags": 4},
{"matrix": [0, 5], "x": 80, "y": 10, "flags": 4},
{"matrix": [1, 5], "x": 80, "y": 22, "flags": 4},
{"matrix": [2, 5], "x": 80, "y": 34, "flags": 4},
{"matrix": [3, 5], "x": 80, "y": 47, "flags": 4},
{"x": 128, "y": 40, "flags": 8},
{"x": 208, "y": 20, "flags": 2},
{"x": 176, "y": 10, "flags": 2},
{"x": 144, "y": 18, "flags": 2},
{"x": 136, "y": 60, "flags": 2},
{"x": 168, "y": 57, "flags": 2},
{"x": 200, "y": 60, "flags": 2},
{"matrix": [9, 0], "x": 192, "y": 57, "flags": 4},
{"matrix": [8, 0], "x": 224, "y": 48, "flags": 4},
{"matrix": [7, 0], "x": 224, "y": 36, "flags": 4},
{"matrix": [6, 0], "x": 224, "y": 24, "flags": 4},
{"matrix": [5, 0], "x": 224, "y": 12, "flags": 4},
{"matrix": [5, 1], "x": 208, "y": 12, "flags": 4},
{"matrix": [6, 1], "x": 208, "y": 24, "flags": 4},
{"matrix": [7, 1], "x": 208, "y": 36, "flags": 4},
{"matrix": [8, 1], "x": 208, "y": 48, "flags": 4},
{"matrix": [9, 1], "x": 176, "y": 55, "flags": 4},
{"matrix": [9, 2], "x": 160, "y": 57, "flags": 4},
{"matrix": [8, 2], "x": 192, "y": 45, "flags": 4},
{"matrix": [7, 2], "x": 192, "y": 33, "flags": 4},
{"matrix": [6, 2], "x": 192, "y": 21, "flags": 4},
{"matrix": [5, 2], "x": 192, "y": 9, "flags": 4},
{"matrix": [5, 3], "x": 176, "y": 7, "flags": 4},
{"matrix": [6, 3], "x": 176, "y": 19, "flags": 4},
{"matrix": [7, 3], "x": 176, "y": 31, "flags": 4},
{"matrix": [8, 3], "x": 176, "y": 43, "flags": 4},
{"matrix": [9, 3], "x": 144, "y": 59, "flags": 4},
{"matrix": [9, 4], "x": 128, "y": 64, "flags": 4},
{"matrix": [8, 4], "x": 160, "y": 45, "flags": 4},
{"matrix": [7, 4], "x": 160, "y": 33, "flags": 4},
{"matrix": [6, 4], "x": 160, "y": 21, "flags": 4},
{"matrix": [5, 4], "x": 160, "y": 9, "flags": 4},
{"matrix": [5, 5], "x": 144, "y": 10, "flags": 4},
{"matrix": [6, 5], "x": 144, "y": 22, "flags": 4},
{"matrix": [7, 5], "x": 144, "y": 34, "flags": 4},
{"matrix": [8, 5], "x": 144, "y": 47, "flags": 4}
]
}
}

0
keyboards/sofle/keyhive/config.h Executable file → Normal file
View File

View File

@ -1,14 +1,11 @@
{
"keyboard_name": "Sofle",
"manufacturer": "Keyhive",
"development_board": "elite_c",
"usb": {
"vid": "0xFC32",
"pid": "0x1287",
"device_version": "0.0.2"
},
"ws2812": {
"pin": "D3"
},
"rgblight": {
"hue_steps": 10,
"led_count": 74,
@ -21,14 +18,12 @@
"cols": ["B6", "B2", "B3", "B1", "F7", "F6", null],
"rows": ["C6", "D7", "E6", "B4", "B5"]
},
"diode_direction": "COL2ROW",
"encoder": {
"rotary": [
{"pin_a": "F5", "pin_b": "F4"}
]
},
"split": {
"soft_serial_pin": "D2",
"encoder": {
"right": {
"rotary": [
@ -44,17 +39,11 @@
},
"transport": {
"sync": {
"matrix_state": true,
"oled": true,
"wpm": true
}
}
},
"qmk": {
"tap_keycode_delay": 10
},
"processor": "atmega32u4",
"bootloader": "atmel-dfu",
"layouts": {
"LAYOUT": {
"layout": [

0
keyboards/sofle/keyhive/readme.md Executable file → Normal file
View File

17
keyboards/sofle/keyhive/rules.mk Executable file → Normal file
View File

@ -1,16 +1 @@
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
ENCODER_ENABLE = yes
LTO_ENABLE = yes
SPLIT_KEYBOARD = yes
OLED_ENABLE = yes
# This file intentionally left blank

View File

@ -1,3 +1,5 @@
// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
enum sofle_layers {
@ -10,16 +12,14 @@ enum sofle_layers {
};
enum custom_keycodes {
KC_QWERTY = SAFE_RANGE,
KC_QWERTY = QK_USER,
KC_COLEMAK,
KC_PRVWD,
KC_NXTWD,
KC_LSTRT,
KC_LEND,
KC_DLINE
KC_LEND
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* QWERTY
@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXXX,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LGUI,KC_LALT,KC_LCTL, MO(_LOWER), KC_ENT, KC_SPC, MO(_RAISE), KC_RCTL, KC_RALT, KC_RGUI
KC_LGUI,KC_LALT,KC_LCTL, TL_LOWR, KC_ENT, KC_SPC, TL_UPPR, KC_RCTL, KC_RALT, KC_RGUI
),
/*
* COLEMAK
@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXXX,KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_LGUI,KC_LALT,KC_LCTL,MO(_LOWER), KC_ENT, KC_SPC, MO(_RAISE), KC_RCTL, KC_RALT, KC_RGUI
KC_LGUI,KC_LALT,KC_LCTL,TL_LOWR, KC_ENT, KC_SPC, TL_UPPR, KC_RCTL, KC_RALT, KC_RGUI
),
/* LOWER
* ,-----------------------------------------. ,-----------------------------------------.
@ -104,9 +104,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_RAISE] = LAYOUT(
_______, _______ , _______ , _______ , _______ , _______, _______, _______ , _______, _______ , _______ ,_______,
_______, KC_INS, KC_PSCR, KC_APP, XXXXXXX, XXXXXXX, KC_PGUP, KC_PRVWD, KC_UP, KC_NXTWD,KC_DLINE, KC_BSPC,
_______, KC_INS, KC_PSCR, KC_APP, XXXXXXX, XXXXXXX, KC_PGUP, KC_PRVWD, KC_UP, KC_NXTWD,C(KC_BSPC), KC_BSPC,
_______, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX, KC_CAPS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_BSPC,
_______,KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, XXXXXXX, _______, _______, XXXXXXX, KC_LSTRT, XXXXXXX, KC_LEND, XXXXXXX, _______,
_______, C(KC_Z), C(KC_X), C(KC_C), C(KC_V), XXXXXXX, _______, _______, XXXXXXX, KC_LSTRT, XXXXXXX, KC_LEND, XXXXXXX, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
/* ADJUST
@ -132,86 +132,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
#ifdef OLED_ENABLE
static void render_logo(void) {
static const char PROGMEM qmk_logo[] = {
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0
};
oled_write_P(qmk_logo, false);
}
static void print_status_narrow(void) {
// Print current mode
oled_write_P(PSTR("\n\n"), false);
oled_write_ln_P(PSTR("MODE"), false);
oled_write_ln_P(PSTR(""), false);
if (keymap_config.swap_lctl_lgui) {
oled_write_ln_P(PSTR("MAC"), false);
} else {
oled_write_ln_P(PSTR("WIN"), false);
}
switch (get_highest_layer(default_layer_state)) {
case _QWERTY:
oled_write_ln_P(PSTR("Qwrt"), false);
break;
case _COLEMAK:
oled_write_ln_P(PSTR("Clmk"), false);
break;
default:
oled_write_P(PSTR("Undef"), false);
}
oled_write_P(PSTR("\n\n"), false);
// Print current layer
oled_write_ln_P(PSTR("LAYER"), false);
switch (get_highest_layer(layer_state)) {
case _COLEMAK:
case _QWERTY:
oled_write_P(PSTR("Base\n"), false);
break;
case _RAISE:
oled_write_P(PSTR("Raise"), false);
break;
case _LOWER:
oled_write_P(PSTR("Lower"), false);
break;
case _ADJUST:
oled_write_P(PSTR("Adj\n"), false);
break;
default:
oled_write_ln_P(PSTR("Undef"), false);
}
oled_write_P(PSTR("\n\n"), false);
led_t led_usb_state = host_keyboard_led_state();
oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
}
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (is_keyboard_master()) {
return OLED_ROTATION_270;
}
return rotation;
}
bool oled_task_user(void) {
if (is_keyboard_master()) {
print_status_narrow();
} else {
render_logo();
}
return false;
}
#endif
layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_QWERTY:
@ -298,73 +218,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
}
break;
case KC_DLINE:
if (record->event.pressed) {
register_mods(mod_config(MOD_LCTL));
register_code(KC_BSPC);
} else {
unregister_mods(mod_config(MOD_LCTL));
unregister_code(KC_BSPC);
}
break;
case KC_COPY:
if (record->event.pressed) {
register_mods(mod_config(MOD_LCTL));
register_code(KC_C);
} else {
unregister_mods(mod_config(MOD_LCTL));
unregister_code(KC_C);
}
return false;
case KC_PASTE:
if (record->event.pressed) {
register_mods(mod_config(MOD_LCTL));
register_code(KC_V);
} else {
unregister_mods(mod_config(MOD_LCTL));
unregister_code(KC_V);
}
return false;
case KC_CUT:
if (record->event.pressed) {
register_mods(mod_config(MOD_LCTL));
register_code(KC_X);
} else {
unregister_mods(mod_config(MOD_LCTL));
unregister_code(KC_X);
}
return false;
break;
case KC_UNDO:
if (record->event.pressed) {
register_mods(mod_config(MOD_LCTL));
register_code(KC_Z);
} else {
unregister_mods(mod_config(MOD_LCTL));
unregister_code(KC_Z);
}
return false;
}
return true;
}
#ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
} else if (index == 1) {
if (clockwise) {
tap_code(KC_PGDN);
} else {
tap_code(KC_PGUP);
}
}
return true;
}
#endif

View File

@ -1,12 +1,10 @@
![SofleKeyboard default keymap](https://github.com/josefadamcik/SofleKeyboard/raw/master/Images/soflekeyboard.png)
![SofleKeyboard adjust layer](https://github.com/josefadamcik/SofleKeyboard/raw/master/Images/soflekeyboard_layout_adjust.png)
![SofleKeyboard default keymap](https://i.imgur.com/MZxVvm9.png)
![SofleKeyboard adjust layer](https://i.imgur.com/f5sKy0I.png)
# Default keymap for Sofle Keyboard
Layout in [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/76efb423a46cbbea75465cb468eef7ff) and [adjust layer](http://www.keyboard-layout-editor.com/#/gists/4bcf66f922cfd54da20ba04905d56bd4)
Features:
- Symmetric modifiers (CMD/Super, Alt/Opt, Ctrl, Shift)
@ -15,5 +13,3 @@ Features:
- Modes for Mac vs Linux/Win support -> different order of modifiers and different action shortcuts on the "UPPER" layer (the red one in the image). Designed to simplify transtions when switching between operating systems often.
- The OLED on master half shows selected mode and caps lock state and is rotated.
- Left encoder controls volume up/down/mute. Right encoder PGUP/PGDOWN.

View File

@ -1,5 +1 @@
OLED_ENABLE = yes
ENCODER_ENABLE = yes
CONSOLE_ENABLE = no
EXTRAKEY_ENABLE = yes
TRI_LAYER_ENABLE = yes

View File

@ -1,50 +0,0 @@
/* Copyright 2020 Josef Adamcik
* Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/* By default left side is selected as master,
see https://docs.qmk.fm/#/feature_split_keyboard?id=setting-handedness
for more options. */
#if defined(KEYBOARD_sofle_rev1)
// Add RGB underglow and top facing lighting
# define WS2812_DI_PIN D3
# define RGBLIGHT_LED_COUNT 72
# define RGBLED_SPLIT \
{ 36, 36 }
# ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_LED_COUNT RGBLIGHT_LED_COUNT
# define RGB_MATRIX_SPLIT RGBLED_SPLIT
# define SPLIT_TRANSPORT_MIRROR
# else
# define RGBLIGHT_EFFECT_BREATHING
# define RGBLIGHT_EFFECT_RAINBOW_MOOD
# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
# define RGBLIGHT_EFFECT_SNAKE
# define RGBLIGHT_EFFECT_KNIGHT
# define RGBLIGHT_EFFECT_CHRISTMAS
# define RGBLIGHT_EFFECT_STATIC_GRADIENT
# define RGBLIGHT_EFFECT_RGB_TEST
# define RGBLIGHT_EFFECT_ALTERNATING
# define RGBLIGHT_EFFECT_TWINKLE
# define RGBLIGHT_LIMIT_VAL 120
# define RGBLIGHT_HUE_STEP 10
# define RGBLIGHT_SAT_STEP 17
# define RGBLIGHT_VAL_STEP 17
# endif
#endif

View File

@ -1,22 +1,21 @@
/* Copyright 2020 Josef Adamcik
* Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "oled.c"
#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {

View File

@ -1,85 +0,0 @@
/* Copyright 2020 Josef Adamcik
* Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//Sets up what the OLED screens display.
#ifdef OLED_ENABLE
static void render_logo(void) {
static const char PROGMEM qmk_logo[] = {
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0
};
oled_write_P(qmk_logo, false);
}
static void print_status_narrow(void) {
// Print current mode
oled_write_P(PSTR("\n\n"), false);
switch (get_highest_layer(layer_state)) {
case 0:
oled_write_ln_P(PSTR("Qwrt"), false);
break;
case 1:
oled_write_ln_P(PSTR("Clmk"), false);
break;
default:
oled_write_P(PSTR("Mod\n"), false);
break;
}
oled_write_P(PSTR("\n\n"), false);
// Print current layer
oled_write_ln_P(PSTR("LAYER"), false);
switch (get_highest_layer(layer_state)) {
case 0:
case 1:
oled_write_P(PSTR("Base\n"), false);
break;
case 2:
oled_write_P(PSTR("Raise"), false);
break;
case 3:
oled_write_P(PSTR("Lower"), false);
break;
default:
oled_write_ln_P(PSTR("Undef"), false);
}
oled_write_P(PSTR("\n\n"), false);
led_t led_usb_state = host_keyboard_led_state();
oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
}
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (is_keyboard_master()) {
return OLED_ROTATION_270;
}
return rotation;
}
bool oled_task_user(void) {
if (is_keyboard_master()) {
print_status_narrow();
} else {
render_logo();
}
return false;
}
#endif

View File

@ -2,7 +2,6 @@
Layout in [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/76efb423a46cbbea75465cb468eef7ff) and [adjust layer](http://www.keyboard-layout-editor.com/#/gists/4bcf66f922cfd54da20ba04905d56bd4)
Features:
- Symmetric modifiers (CMD/Super, Alt/Opt, Ctrl, Shift)
@ -11,4 +10,3 @@ Features:
- Left encoder controls volume up/down/mute. Right encoder PGUP/PGDOWN.
- Via support
- RGB underglow support

View File

@ -1,8 +1,3 @@
OLED_ENABLE = yes
ENCODER_ENABLE = yes
CONSOLE_ENABLE = no
EXTRAKEY_ENABLE = yes
VIA_ENABLE = yes
LTO_ENABLE = yes
RGBLIGHT_ENABLE = yes
RGB_MATRIX_ENABLE = yes
ENCODER_MAP_ENABLE = yes

View File

@ -1,6 +1,6 @@
# Sofle Keyboard
![SofleKeyboard version 1](https://raw.githubusercontent.com/josefadamcik/SofleKeyboard/master/Images/IMG_20200126_114622.jpg)
![SofleKeyboard version 1](https://i.imgur.com/S5GTKth.jpeg)
Sofle is 6×4+5 keys column-staggered split keyboard. Based on Lily58, Corne and Helix keyboards.

View File

@ -1,10 +1,9 @@
{
"keyboard_name": "Sofle",
"manufacturer": "JosefAdamcik",
"url": "https://github.com/josefadamcik/SofleKeyboard",
"maintainer": "Josef Adamcik <josef.adamcik@gmail.com>",
"development_board": "promicro",
"usb": {
"vid": "0xFC32",
"pid": "0x0287",
"device_version": "0.0.1"
},
@ -12,14 +11,12 @@
"cols": ["F6", "F7", "B1", "B3", "B2", "B6"],
"rows": ["C6", "D7", "E6", "B4", "B5"]
},
"diode_direction": "COL2ROW",
"encoder": {
"rotary": [
{"pin_a": "F5", "pin_b": "F4", "resolution": 2}
]
},
"split": {
"soft_serial_pin": "D2",
"encoder": {
"right": {
"rotary": [
@ -28,14 +25,6 @@
}
}
},
"tapping": {
"term": 100
},
"qmk": {
"tap_keycode_delay": 10
},
"processor": "atmega32u4",
"bootloader": "caterina",
"layouts": {
"LAYOUT": {
"layout": [

View File

@ -1,6 +1,6 @@
# Sofle Keyboard
![SofleKeyboard version 1](https://raw.githubusercontent.com/josefadamcik/SofleKeyboard/master/Images/IMG_20200126_114622.jpg)
![SofleKeyboard version 1](https://i.imgur.com/S5GTKth.jpeg)
Sofle is 6×4+5 keys column-staggered split keyboard. Based on Lily58, Corne and Helix keyboards.

View File

@ -1,87 +0,0 @@
/* Copyright 2021 Carlos Martins
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "quantum.h"
#ifdef RGB_MATRIX_ENABLE
// Physical Layout
// Columns
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
// ROWS
// 12 13 22 23 32 33 33 32 23 22 13 12 0
// 02 03 04 04 03 02
// 11 14 21 24 31 34 34 31 24 21 14 11 1
// 01 01
// 10 15 20 25 30 35 35 30 25 20 15 10 2
//
// 09 16 19 26 29 36 36 29 26 19 16 09 3
//
// 08 17 18 27 28 28 27 18 17 08 4
// 07 06 05 05 06 07
led_config_t g_led_config = {
{
{ 11, 12, 21, 22, 31, 32 },
{ 10, 13, 20, 23, 30, 33 },
{ 9, 14, 19, 24, 29, 34},
{ 8, 15, 18, 25, 28, 35},
{ 7, 16, 17, 26, 27, NO_LED },
{ 47, 48, 57, 58, 67, 68},
{ 46, 49, 56, 59, 66, 69},
{ 45, 50, 55, 60, 65, 70},
{ 44, 51, 54, 61, 64, 71},
{ 43, 52, 53, 62, 63, NO_LED }
},
{
// Left side underglow
{96, 40}, {16, 20}, {48, 10}, {80, 18}, {88, 60}, {56, 57}, {24,60},
// Left side Matrix
{32, 57}, { 0, 48}, { 0, 36}, { 0, 24}, { 0, 12},
{16, 12}, {16, 24}, {16, 36}, {16, 48}, {48, 55},
{64, 57}, {32, 45}, {32, 33}, {32, 21}, {32, 9},
{48, 7}, {48, 19}, {48, 31}, {48, 43}, {80, 59},
{96, 64}, {64, 45}, {64, 33}, {64, 21}, {64, 9},
{80, 10}, {80, 22}, {80, 34}, {80, 47},
// Right side underglow
{128, 40}, {208, 20}, {176, 10}, {144, 18}, {136, 60}, {168, 57}, {200,60},
// Right side Matrix
{192, 57}, {224, 48}, {224, 36}, {224, 24}, {224, 12},
{208, 12}, {208, 24}, {208, 36}, {208, 48}, {176, 55},
{160, 57}, {192, 45}, {192, 33}, {192, 21}, {192, 9},
{176, 7}, {176, 19}, {176, 31}, {176, 43}, {144, 59},
{128, 64}, {160, 45}, {160, 33}, {160, 21}, {160, 9},
{144, 10}, {144, 22}, {144, 34}, {144, 47},
},
{
LED_FLAG_INDICATOR, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
LED_FLAG_INDICATOR, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT
}
};
#endif

View File

@ -1,2 +1 @@
ENCODER_ENABLE = yes
OLED_ENABLE = yes
# This file intentionally left blank

View File

@ -1,3 +1 @@
SPLIT_KEYBOARD = yes
DEFAULT_FOLDER = sofle/rev1
SWAP_HANDS_ENABLE = yes

View File

@ -1,3 +1,5 @@
// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#include "quantum.h"
#ifdef SWAP_HANDS_ENABLE
@ -44,3 +46,90 @@ const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {1, 0};
# endif
#endif
#ifdef OLED_ENABLE
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
if (is_keyboard_master()) {
return OLED_ROTATION_270;
}
return rotation;
}
static void render_logo(void) {
static const char PROGMEM qmk_logo[] = {
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0
};
oled_write_P(qmk_logo, false);
}
void print_status_narrow(void) {
oled_write_P(PSTR("\n\n"), false);
switch (get_highest_layer(layer_state)) {
case 0:
oled_write_ln_P(PSTR("Qwrt"), false);
break;
case 1:
oled_write_ln_P(PSTR("Clmk"), false);
break;
default:
oled_write_P(PSTR("Mod\n"), false);
break;
}
oled_write_P(PSTR("\n\n"), false);
oled_write_ln_P(PSTR("LAYER"), false);
switch (get_highest_layer(layer_state)) {
case 0:
case 1:
oled_write_P(PSTR("Base\n"), false);
break;
case 2:
oled_write_P(PSTR("Raise"), false);
break;
case 3:
oled_write_P(PSTR("Lower"), false);
break;
default:
oled_write_ln_P(PSTR("Undef"), false);
}
oled_write_P(PSTR("\n\n"), false);
led_t led_usb_state = host_keyboard_led_state();
oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
}
bool oled_task_kb(void) {
if (!oled_task_user()) {
return false;
}
if (is_keyboard_master()) {
print_status_narrow();
} else {
render_logo();
}
return true;
}
#endif
#ifdef ENCODER_ENABLE
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) {
return false;
}
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
} else if (index == 1) {
if (clockwise) {
tap_code(KC_PGDN);
} else {
tap_code(KC_PGUP);
}
}
return true;
}
#endif

View File

@ -33,18 +33,11 @@ def _generate_layouts(keyboard, kb_info_json):
layout_keys = []
layout_matrix = [['KC_NO'] * col_num for _ in range(row_num)]
for index, key_data in enumerate(layout_data['layout']):
for key_data in layout_data['layout']:
row, col = key_data['matrix']
identifier = f'k{ROW_LETTERS[row]}{COL_LETTERS[col]}'
if row >= row_num or col >= col_num:
key_name = key_data.get('label', identifier)
if row >= row_num:
cli.log.error(f'{keyboard}/{layout_name}: Matrix row for key {index} ({key_name}) is {row} but must be less than {row_num}')
if col >= col_num:
cli.log.error(f'{keyboard}/{layout_name}: Matrix column for key {index} ({key_name}) is {col} but must be less than {col_num}')
cli.log.error(f'Skipping layouts due to {layout_name} containing invalid matrix values')
return []
layout_matrix[row][col] = identifier

View File

@ -7,7 +7,7 @@ from dotty_dict import dotty
from milc import cli
from qmk.constants import CHIBIOS_PROCESSORS, LUFA_PROCESSORS, VUSB_PROCESSORS
from qmk.constants import COL_LETTERS, ROW_LETTERS, CHIBIOS_PROCESSORS, LUFA_PROCESSORS, VUSB_PROCESSORS
from qmk.c_parse import find_layouts, parse_config_h_file, find_led_config
from qmk.json_schema import deep_update, json_load, validate
from qmk.keyboard import config_h, rules_mk
@ -78,9 +78,11 @@ def _find_invalid_encoder_index(info_data):
return ret
def _additional_validation(keyboard, info_data):
def _validate_layouts(keyboard, info_data):
"""Non schema checks
"""
col_num = info_data.get('matrix_size', {}).get('cols', 0)
row_num = info_data.get('matrix_size', {}).get('rows', 0)
layouts = info_data.get('layouts', {})
layout_aliases = info_data.get('layout_aliases', {})
community_layouts = info_data.get('community_layouts', [])
@ -90,6 +92,16 @@ def _additional_validation(keyboard, info_data):
if len(layouts) == 0 or all(not layout.get('json_layout', False) for layout in layouts.values()):
_log_error(info_data, 'No LAYOUTs defined! Need at least one layout defined in info.json.')
# Make sure all matrix values are in bounds
for layout_name, layout_data in layouts.items():
for index, key_data in enumerate(layout_data['layout']):
row, col = key_data['matrix']
key_name = key_data.get('label', f'k{ROW_LETTERS[row]}{COL_LETTERS[col]}')
if row >= row_num:
_log_error(info_data, f'{layout_name}: Matrix row for key {index} ({key_name}) is {row} but must be less than {row_num}')
if col >= col_num:
_log_error(info_data, f'{layout_name}: Matrix column for key {index} ({key_name}) is {col} but must be less than {col_num}')
# Warn if physical positions are offset (at least one key should be at x=0, and at least one key at y=0)
for layout_name, layout_data in layouts.items():
offset_x = min([_get_key_left_position(k) for k in layout_data['layout']])
@ -122,12 +134,20 @@ def _additional_validation(keyboard, info_data):
if layout_name not in layouts and layout_name not in layout_aliases:
_log_error(info_data, 'Claims to support community layout %s but no %s() macro found' % (layout, layout_name))
def _validate_keycodes(keyboard, info_data):
"""Non schema checks
"""
# keycodes with length > 7 must have short forms for visualisation purposes
for decl in info_data.get('keycodes', []):
if len(decl["key"]) > 7:
if not decl.get("aliases", []):
_log_error(info_data, f'Keycode {decl["key"]} has no short form alias')
def _validate_encoders(keyboard, info_data):
"""Non schema checks
"""
# encoder IDs in layouts must be in range and not duplicated
found = _find_invalid_encoder_index(info_data)
for layout_name, encoder_index, reason in found:
@ -141,7 +161,10 @@ def _validate(keyboard, info_data):
try:
validate(info_data, 'qmk.api.keyboard.v1')
_additional_validation(keyboard, info_data)
# Additional validation
_validate_layouts(keyboard, info_data)
_validate_keycodes(keyboard, info_data)
_validate_encoders(keyboard, info_data)
except jsonschema.ValidationError as e:
json_path = '.'.join([str(p) for p in e.absolute_path])

View File

@ -24,10 +24,3 @@
#pragma once
#include "avr/xprintf.h"
// Create user & normal print defines
#define print(s) xputs(PSTR(s))
#define println(s) xputs(PSTR(s "\r\n"))
#define uprint(s) xputs(PSTR(s))
#define uprintln(s) xputs(PSTR(s "\r\n"))
#define uprintf(fmt, ...) __xprintf(PSTR(fmt), ##__VA_ARGS__)

View File

@ -183,9 +183,7 @@ void led_task(void) {
last_led_modification_time = timer_read32();
if (debug_keyboard) {
debug("led_task: ");
debug_hex8(led_status);
debug("\n");
dprintf("led_task: %02X\n", led_status);
}
led_set(led_status);
}

View File

@ -54,116 +54,14 @@ extern debug_config_t debug_config;
* Debug print utils
*/
#ifndef NO_DEBUG
# define dprint(s) \
do { \
if (debug_enable) print(s); \
# define dprintf(fmt, ...) \
do { \
if (debug_config.enable) xprintf(fmt, ##__VA_ARGS__); \
} while (0)
# define dprintln(s) \
do { \
if (debug_enable) println(s); \
} while (0)
# define dprintf(fmt, ...) \
do { \
if (debug_enable) xprintf(fmt, ##__VA_ARGS__); \
} while (0)
# define dmsg(s) dprintf("%s at %d: %s\n", __FILE__, __LINE__, s)
/* Deprecated. DO NOT USE these anymore, use dprintf instead. */
# define debug(s) \
do { \
if (debug_enable) print(s); \
} while (0)
# define debugln(s) \
do { \
if (debug_enable) println(s); \
} while (0)
# define debug_msg(s) \
do { \
if (debug_enable) { \
print(__FILE__); \
print(" at "); \
print_dec(__LINE__); \
print(" in "); \
print(": "); \
print(s); \
} \
} while (0)
# define debug_dec(data) \
do { \
if (debug_enable) print_dec(data); \
} while (0)
# define debug_decs(data) \
do { \
if (debug_enable) print_decs(data); \
} while (0)
# define debug_hex4(data) \
do { \
if (debug_enable) print_hex4(data); \
} while (0)
# define debug_hex8(data) \
do { \
if (debug_enable) print_hex8(data); \
} while (0)
# define debug_hex16(data) \
do { \
if (debug_enable) print_hex16(data); \
} while (0)
# define debug_hex32(data) \
do { \
if (debug_enable) print_hex32(data); \
} while (0)
# define debug_bin8(data) \
do { \
if (debug_enable) print_bin8(data); \
} while (0)
# define debug_bin16(data) \
do { \
if (debug_enable) print_bin16(data); \
} while (0)
# define debug_bin32(data) \
do { \
if (debug_enable) print_bin32(data); \
} while (0)
# define debug_bin_reverse8(data) \
do { \
if (debug_enable) print_bin_reverse8(data); \
} while (0)
# define debug_bin_reverse16(data) \
do { \
if (debug_enable) print_bin_reverse16(data); \
} while (0)
# define debug_bin_reverse32(data) \
do { \
if (debug_enable) print_bin_reverse32(data); \
} while (0)
# define debug_hex(data) debug_hex8(data)
# define debug_bin(data) debug_bin8(data)
# define debug_bin_reverse(data) debug_bin8(data)
#else /* NO_DEBUG */
# define dprint(s)
# define dprintln(s)
# define dprintf(fmt, ...)
# define dmsg(s)
# define debug(s)
# define debugln(s)
# define debug_msg(s)
# define debug_dec(data)
# define debug_decs(data)
# define debug_hex4(data)
# define debug_hex8(data)
# define debug_hex16(data)
# define debug_hex32(data)
# define debug_bin8(data)
# define debug_bin16(data)
# define debug_bin32(data)
# define debug_bin_reverse8(data)
# define debug_bin_reverse16(data)
# define debug_bin_reverse32(data)
# define debug_hex(data)
# define debug_bin(data)
# define debug_bin_reverse(data)
#endif /* NO_DEBUG */
#define dprint(s) dprintf(s)
#define dprintln(s) dprintf(s "\r\n")
#define dmsg(s) dprintf("%s at %d: %s\n", __FILE__, __LINE__, s)

View File

@ -52,40 +52,27 @@ void print_set_sendchar(sendchar_func_t func);
# if __has_include_next("_print.h")
# include_next "_print.h" /* Include the platforms print.h */
# else
// Fall back to lib/printf
# include "printf.h" // lib/printf/printf.h
// Create user & normal print defines
# define print(s) printf(s)
# define println(s) printf(s "\r\n")
# include "printf.h" // // Fall back to lib/printf/printf.h
# define xprintf printf
# define uprint(s) printf(s)
# define uprintln(s) printf(s "\r\n")
# define uprintf printf
# endif /* __has_include_next("_print.h") */
#else /* NO_PRINT */
# undef xprintf
# endif
#else
// Remove print defines
# define print(s)
# define println(s)
# undef xprintf
# define xprintf(fmt, ...)
# define uprintf(fmt, ...)
# define uprint(s)
# define uprintln(s)
#endif
#endif /* NO_PRINT */
// Resolve before USER_PRINT can remove
#define uprintf xprintf
#ifdef USER_PRINT
// Remove normal print defines
# undef print
# undef println
# undef xprintf
# define print(s)
# define println(s)
# define xprintf(fmt, ...)
#endif
#define print(s) xprintf(s)
#define println(s) xprintf(s "\r\n")
#define print_dec(i) xprintf("%u", i)
#define print_decs(i) xprintf("%d", i)
/* hex */
@ -121,6 +108,9 @@ void print_set_sendchar(sendchar_func_t func);
//
// !!! DO NOT USE USER PRINT CALLS IN THE BODY OF QMK/TMK !!!
#define uprint(s) uprintf(s)
#define uprintln(s) uprintf(s "\r\n")
/* decimal */
#define uprint_dec(i) uprintf("%u", i)
#define uprint_decs(i) uprintf("%d", i)

View File

@ -22,6 +22,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "keycode.h"
#include "util.h"
#ifdef JOYSTICK_ENABLE
# include "joystick.h"
#endif
// clang-format off
/* HID report IDs */

View File

@ -3,6 +3,11 @@
_qmk_install() {
echo "Installing dependencies"
. /etc/os-release
if [ "$VERSION_ID" == "39" ]; then
sudo dnf $SKIP_PROMPT copr enable erovia/dfu-programmer
fi
# TODO: Check whether devel/headers packages are really needed
sudo dnf $SKIP_PROMPT install \
clang diffutils git gcc glibc-headers kernel-devel kernel-headers \