删除非对齐地址访问语句和__CORTEX_M宏定义判断
Signed-off-by: SimpleInit <63694297@qq.com>
This commit is contained in:
parent
bfebcac4d3
commit
a70808ce9e
|
@ -233,8 +233,8 @@ static rt_err_t _send_cmd(
|
||||||
}
|
}
|
||||||
else if (type == response_r2)
|
else if (type == response_r2)
|
||||||
{
|
{
|
||||||
#if defined(__CORTEX_M) && __CORTEX_M == 0
|
|
||||||
/* initial message */
|
/* initial message */
|
||||||
|
/* Prevent non-aligned address access, use recv_buffer to receive data */
|
||||||
message.send_buf = RT_NULL;
|
message.send_buf = RT_NULL;
|
||||||
message.recv_buf = recv_buffer;
|
message.recv_buf = recv_buffer;
|
||||||
message.length = 1;
|
message.length = 1;
|
||||||
|
@ -243,20 +243,9 @@ static rt_err_t _send_cmd(
|
||||||
/* transfer message */
|
/* transfer message */
|
||||||
device->bus->ops->xfer(device, &message);
|
device->bus->ops->xfer(device, &message);
|
||||||
response[1] = recv_buffer[0];
|
response[1] = recv_buffer[0];
|
||||||
#else
|
|
||||||
/* initial message */
|
|
||||||
message.send_buf = RT_NULL;
|
|
||||||
message.recv_buf = response + 1;
|
|
||||||
message.length = 1;
|
|
||||||
message.cs_take = message.cs_release = 0;
|
|
||||||
|
|
||||||
/* transfer message */
|
|
||||||
device->bus->ops->xfer(device, &message);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if ((type == response_r3) || (type == response_r7))
|
else if ((type == response_r3) || (type == response_r7))
|
||||||
{
|
{
|
||||||
#if defined(__CORTEX_M) && __CORTEX_M == 0
|
|
||||||
/* initial message */
|
/* initial message */
|
||||||
message.send_buf = RT_NULL;
|
message.send_buf = RT_NULL;
|
||||||
message.recv_buf = recv_buffer;
|
message.recv_buf = recv_buffer;
|
||||||
|
@ -269,16 +258,6 @@ static rt_err_t _send_cmd(
|
||||||
response[2] = recv_buffer[1];
|
response[2] = recv_buffer[1];
|
||||||
response[3] = recv_buffer[2];
|
response[3] = recv_buffer[2];
|
||||||
response[4] = recv_buffer[3];
|
response[4] = recv_buffer[3];
|
||||||
#else
|
|
||||||
/* initial message */
|
|
||||||
message.send_buf = RT_NULL;
|
|
||||||
message.recv_buf = response + 1;
|
|
||||||
message.length = 4;
|
|
||||||
message.cs_take = message.cs_release = 0;
|
|
||||||
|
|
||||||
/* transfer message */
|
|
||||||
device->bus->ops->xfer(device, &message);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue