feat add sem obtain wait_time and modify e220 lora receive len operation

This commit is contained in:
Liu_Weichao
2022-04-26 17:57:32 +08:00
parent 63d26584b7
commit 808f00ade1
28 changed files with 287 additions and 15 deletions
+2 -1
View File
@@ -68,11 +68,12 @@ void InstallConsole(const char *bus_name, const char *drv_name, const char *dev_
BusDevClose(_console);
}
console_bus->match(console_drv, console);
configure_info.configure_cmd = OPE_INT;
memset(&serial_cfg, 0, sizeof(struct SerialCfgParam));
configure_info.private_data = &serial_cfg;
BusDrvConfigure(console_drv, &configure_info);
console_bus->match(console_drv, console);
serial_dev_param = (struct SerialDevParam *)console->private_data;
serial_dev_param->serial_set_mode = 0;
+6 -1
View File
@@ -96,7 +96,12 @@ static x_err_t _MsgQueueSend(struct MsgQueue *mq,
tick_delta = 0;
task = GetKTaskDescriptor();
timeout = CalculteTickFromTimeMs(msec);
if(WAITING_FOREVER == msec)
timeout = WAITING_FOREVER;
else
timeout = CalculteTickFromTimeMs(msec);
lock = CriticalAreaLock();
if (mq->num_msgs >= mq->max_msgs && timeout == 0) {
CriticalAreaUnLock(lock);
+5 -1
View File
@@ -95,7 +95,11 @@ static int32 _SemaphoreObtain(struct Semaphore *sem, int32 msec)
NULL_PARAM_CHECK(sem);
wait_time = CalculteTickFromTimeMs(msec);
if(WAITING_FOREVER == msec)
wait_time = WAITING_FOREVER;
else
wait_time = CalculteTickFromTimeMs(msec);
lock = CriticalAreaLock();
SYS_KDEBUG_LOG(KDBG_IPC, ("obtain semaphore: id %d, value %d, by task %s\n",