mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-03-24 09:30:19 +08:00
[rt-link] fix the compiling issue under 64bit arch #11018
Some checks failed
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / A9 :components/dfs.cfg (push) Has been cancelled
utest_auto_run / A9 :components/lwip.cfg (push) Has been cancelled
utest_auto_run / A9 :components/netdev.cfg (push) Has been cancelled
utest_auto_run / A9 :components/sal.cfg (push) Has been cancelled
utest_auto_run / A9 :cpp11/cpp11.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/mem.cfg (push) Has been cancelled
Some checks failed
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / A9 :components/dfs.cfg (push) Has been cancelled
utest_auto_run / A9 :components/lwip.cfg (push) Has been cancelled
utest_auto_run / A9 :components/netdev.cfg (push) Has been cancelled
utest_auto_run / A9 :components/sal.cfg (push) Has been cancelled
utest_auto_run / A9 :cpp11/cpp11.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/mem.cfg (push) Has been cancelled
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
#define RT_LINK_THREAD_NAME "rtlink"
|
||||
#define RT_LINK_THREAD_TICK 20
|
||||
#define RT_LINK_THREAD_PRIORITY 25
|
||||
#define RT_LINK_THREAD_STACK_SIZE 1024 /* 32 bytes aligned */
|
||||
#define RT_LINK_THREAD_STACK_SIZE (4 * 1024) /* 32 bytes aligned */
|
||||
|
||||
#define RT_LINK_FRAME_SENT 1
|
||||
#define RT_LINK_FRAME_NOSEND 0
|
||||
@@ -905,8 +905,8 @@ static void rt_link_frame_recv_timeout(void)
|
||||
|
||||
static void rt_link_send_timeout(void)
|
||||
{
|
||||
LOG_D("send count(%d)", (rt_uint32_t)rt_link_scb->sendtimer.parameter);
|
||||
if ((rt_uint32_t)rt_link_scb->sendtimer.parameter >= 5)
|
||||
LOG_D("send count(%d)", (rt_ubase_t)rt_link_scb->sendtimer.parameter);
|
||||
if ((rt_ubase_t)rt_link_scb->sendtimer.parameter >= 5)
|
||||
{
|
||||
rt_timer_stop(&rt_link_scb->sendtimer);
|
||||
LOG_W("Send timeout, please check the link status!");
|
||||
@@ -929,7 +929,7 @@ static void rt_link_send_timeout(void)
|
||||
|
||||
static void rt_link_long_recv_timeout(void)
|
||||
{
|
||||
if ((rt_uint32_t)rt_link_scb->longframetimer.parameter >= 5)
|
||||
if ((rt_ubase_t)rt_link_scb->longframetimer.parameter >= 5)
|
||||
{
|
||||
LOG_W("long package receive timeout");
|
||||
rt_link_scb->longframetimer.parameter = 0x00;
|
||||
@@ -996,7 +996,7 @@ void rt_link_thread(void *parameter)
|
||||
|
||||
static void rt_link_sendtimer_callback(void *parameter)
|
||||
{
|
||||
rt_uint32_t count = (rt_uint32_t)rt_link_scb->sendtimer.parameter + 1;
|
||||
rt_ubase_t count = (rt_ubase_t)rt_link_scb->sendtimer.parameter + 1;
|
||||
rt_link_scb->sendtimer.parameter = (void *)count;
|
||||
rt_event_send(&rt_link_scb->event, RT_LINK_SEND_TIMEOUT_EVENT);
|
||||
}
|
||||
@@ -1008,7 +1008,7 @@ static void rt_link_recvtimer_callback(void *parameter)
|
||||
|
||||
static void rt_link_receive_long_frame_callback(void *parameter)
|
||||
{
|
||||
rt_uint32_t count = (rt_uint32_t)rt_link_scb->longframetimer.parameter + 1;
|
||||
rt_ubase_t count = (rt_ubase_t)rt_link_scb->longframetimer.parameter + 1;
|
||||
rt_link_scb->longframetimer.parameter = (void *)count;
|
||||
rt_event_send(&rt_link_scb->event, RT_LINK_RECV_TIMEOUT_LONG_EVENT);
|
||||
}
|
||||
@@ -1174,8 +1174,8 @@ MSH_CMD_EXPORT(rtlink_status, Display RTLINK status);
|
||||
* */
|
||||
rt_err_t rt_link_deinit(void)
|
||||
{
|
||||
rt_enter_critical();
|
||||
rt_link_hw_deinit();
|
||||
rt_enter_critical();
|
||||
if (rt_link_scb)
|
||||
{
|
||||
rt_timer_detach(&rt_link_scb->longframetimer);
|
||||
@@ -1235,6 +1235,13 @@ int rt_link_init(void)
|
||||
rt_slist_init(&rt_link_scb->tx_data_slist);
|
||||
rt_link_scb->tx_seq = RT_LINK_INIT_FRAME_SEQENCE;
|
||||
|
||||
if (RT_EOK != rt_link_hw_init())
|
||||
{
|
||||
LOG_E("rtlink hw init failed.");
|
||||
result = -RT_ERROR;
|
||||
goto __exit;
|
||||
}
|
||||
|
||||
/* create rtlink core work thread */
|
||||
thread = rt_thread_create(RT_LINK_THREAD_NAME,
|
||||
rt_link_thread,
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statfs.h>
|
||||
#include <poll.h>
|
||||
#include <dfs_file.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
int rtlink_fops_open(struct dfs_file *fd)
|
||||
{
|
||||
@@ -82,9 +84,9 @@ int rtlink_fops_ioctl(struct dfs_file *fd, int cmd, void *args)
|
||||
}
|
||||
}
|
||||
|
||||
int rtlink_fops_read(struct dfs_file *fd, void *buf, size_t count)
|
||||
ssize_t rtlink_fops_read(struct dfs_file *fd, void *buf, size_t count)
|
||||
{
|
||||
int size = 0;
|
||||
ssize_t size = 0;
|
||||
rt_device_t device;
|
||||
device = (rt_device_t)fd->vnode->data;
|
||||
|
||||
@@ -96,9 +98,9 @@ int rtlink_fops_read(struct dfs_file *fd, void *buf, size_t count)
|
||||
return size;
|
||||
}
|
||||
|
||||
int rtlink_fops_write(struct dfs_file *fd, const void *buf, size_t count)
|
||||
ssize_t rtlink_fops_write(struct dfs_file *fd, const void *buf, size_t count)
|
||||
{
|
||||
int size = 0;
|
||||
ssize_t size = 0;
|
||||
rt_device_t device;
|
||||
device = (rt_device_t)fd->vnode->data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user