forked from mirror/qmk_firmware
[CI] Format code according to conventions (#25827)
Format code according to conventions
This commit is contained in:
@@ -40,7 +40,7 @@ uint32_t eeprom_read_dword(const uint32_t *addr) {
|
||||
|
||||
void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
||||
const uint8_t *p = (const uint8_t *)addr;
|
||||
uint8_t * dest = (uint8_t *)buf;
|
||||
uint8_t *dest = (uint8_t *)buf;
|
||||
while (len--) {
|
||||
*dest++ = eeprom_read_byte(p++);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ void eeprom_write_dword(uint32_t *addr, uint32_t value) {
|
||||
}
|
||||
|
||||
void eeprom_write_block(const void *buf, void *addr, size_t len) {
|
||||
uint8_t * p = (uint8_t *)addr;
|
||||
uint8_t *p = (uint8_t *)addr;
|
||||
const uint8_t *src = (const uint8_t *)buf;
|
||||
while (len--) {
|
||||
eeprom_write_byte(p++, *src++);
|
||||
@@ -87,7 +87,7 @@ void eeprom_update_dword(uint32_t *addr, uint32_t value) {
|
||||
}
|
||||
|
||||
void eeprom_update_block(const void *buf, void *addr, size_t len) {
|
||||
uint8_t * p = (uint8_t *)addr;
|
||||
uint8_t *p = (uint8_t *)addr;
|
||||
const uint8_t *src = (const uint8_t *)buf;
|
||||
while (len--) {
|
||||
eeprom_write_byte(p++, *src++);
|
||||
|
||||
@@ -52,7 +52,7 @@ extern "C" {
|
||||
#define BYTE_VALUE(addr, value) (((addr) << 8) | (value))
|
||||
#define WORD_ZERO(addr) (0x8000 | ((addr) >> 1))
|
||||
#define WORD_ONE(addr) (0xA000 | ((addr) >> 1))
|
||||
#define WORD_NEXT(addr) (0xE000 | (((addr)-0x80) >> 1))
|
||||
#define WORD_NEXT(addr) (0xE000 | (((addr) - 0x80) >> 1))
|
||||
|
||||
class EepromStm32Test : public testing::Test {
|
||||
public:
|
||||
|
||||
@@ -35,9 +35,9 @@ FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) {
|
||||
if (flash_locked) return FLASH_ERROR_WRP;
|
||||
Address -= (uintptr_t)FlashBuf;
|
||||
if (Address >= MOCK_FLASH_SIZE) return FLASH_BAD_ADDRESS;
|
||||
uint16_t oldData = *(uint16_t*)&FlashBuf[Address];
|
||||
uint16_t oldData = *(uint16_t *)&FlashBuf[Address];
|
||||
if (oldData == 0xFFFF || Data == 0) {
|
||||
*(uint16_t*)&FlashBuf[Address] = Data;
|
||||
*(uint16_t *)&FlashBuf[Address] = Data;
|
||||
return FLASH_COMPLETE;
|
||||
} else {
|
||||
return FLASH_ERROR_PG;
|
||||
|
||||
Reference in New Issue
Block a user