Misc post-merge fixups
This commit is contained in:
parent
eee4a3660c
commit
4d6fa0ccfa
3 changed files with 10 additions and 5 deletions
|
@ -178,7 +178,7 @@ static void _spi_buf_prepare(uint8_t bus, size_t len, spi_endianness_t e, spi_wo
|
||||||
if (e == SPI_LITTLE_ENDIAN || word_size == SPI_32BIT) return;
|
if (e == SPI_LITTLE_ENDIAN || word_size == SPI_32BIT) return;
|
||||||
|
|
||||||
size_t count = word_size == SPI_16BIT ? (len + 1) / 2 : (len + 3) / 4;
|
size_t count = word_size == SPI_16BIT ? (len + 1) / 2 : (len + 3) / 4;
|
||||||
uint32_t *data = (uint32_t *)&SPI(bus).W0;
|
uint32_t *data = (uint32_t *)SPI(bus).W;
|
||||||
for (size_t i = 0; i < count; i ++)
|
for (size_t i = 0; i < count; i ++)
|
||||||
{
|
{
|
||||||
data[i] = word_size == SPI_16BIT
|
data[i] = word_size == SPI_16BIT
|
||||||
|
@ -193,14 +193,14 @@ static void _spi_buf_transfer(uint8_t bus, const void *out_data, void *in_data,
|
||||||
_wait(bus);
|
_wait(bus);
|
||||||
size_t bytes = len * (uint8_t)word_size;
|
size_t bytes = len * (uint8_t)word_size;
|
||||||
_set_size(bus, bytes);
|
_set_size(bus, bytes);
|
||||||
memcpy((void *)&SPI(bus).W0, out_data, bytes);
|
memcpy((void *)SPI(bus).W, out_data, bytes);
|
||||||
_spi_buf_prepare(bus, len, e, word_size);
|
_spi_buf_prepare(bus, len, e, word_size);
|
||||||
_start(bus);
|
_start(bus);
|
||||||
_wait(bus);
|
_wait(bus);
|
||||||
if (in_data)
|
if (in_data)
|
||||||
{
|
{
|
||||||
_spi_buf_prepare(bus, len, e, word_size);
|
_spi_buf_prepare(bus, len, e, word_size);
|
||||||
memcpy(in_data, (void *)&SPI(bus).W0, bytes);
|
memcpy(in_data, (void *)SPI(bus).W, bytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ sdk_SpiFlashOpResult sdk_spi_flash_erase_sector(uint16_t sec);
|
||||||
src is pointer to a buffer to read bytes from. Should be 4-byte aligned.
|
src is pointer to a buffer to read bytes from. Should be 4-byte aligned.
|
||||||
size is length of buffer in bytes. Should be a multiple of 4.
|
size is length of buffer in bytes. Should be a multiple of 4.
|
||||||
*/
|
*/
|
||||||
sdk_SpiFlashOpResult sdk_spi_flash_write(uint32_t des_addr, const void *src, uint32_t size);
|
sdk_SpiFlashOpResult sdk_spi_flash_write(uint32_t des_addr, uint32_t *src, uint32_t size);
|
||||||
|
|
||||||
/* Read data from flash.
|
/* Read data from flash.
|
||||||
|
|
||||||
|
@ -44,8 +44,12 @@ sdk_SpiFlashOpResult sdk_spi_flash_write(uint32_t des_addr, const void *src, uin
|
||||||
des is pointer to a buffer to read bytes into. Should be 4-byte aligned.
|
des is pointer to a buffer to read bytes into. Should be 4-byte aligned.
|
||||||
size is number of bytes to read. Should be a multiple of 4.
|
size is number of bytes to read. Should be a multiple of 4.
|
||||||
*/
|
*/
|
||||||
sdk_SpiFlashOpResult sdk_spi_flash_read(uint32_t src_addr, void *des, uint32_t size);
|
sdk_SpiFlashOpResult sdk_spi_flash_read(uint32_t src_addr, uint32_t *des, uint32_t size);
|
||||||
|
|
||||||
|
/* SDK uses this structure internally to account for flash size.
|
||||||
|
|
||||||
|
See flashchip.h for more info.
|
||||||
|
*/
|
||||||
extern sdk_flashchip_t sdk_flashchip;
|
extern sdk_flashchip_t sdk_flashchip;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "etstimer.h"
|
#include "etstimer.h"
|
||||||
|
#include "stdio.h"
|
||||||
|
|
||||||
struct timer_list_st {
|
struct timer_list_st {
|
||||||
struct timer_list_st *next;
|
struct timer_list_st *next;
|
||||||
|
|
Loading…
Reference in a new issue