Skip to content

Commit

Permalink
fix event don't show set value issue| 修复事件不显示标志的值的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Guozhanxin committed May 19, 2018
1 parent 301101a commit cc1a295
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
4 changes: 2 additions & 2 deletions SystemView_Description/SYSVIEW_RT-Thread.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ TaskState 0xFC 0=Ready, 8=Wait for event, 16=Wait for sema zero, 24=Waiting, 32=
53 mutex_release Release Lock=%s
54 OS_SignalEvent Task=%t EventMask=%b
55 OS_ClearEvents Task=%t | Returns %b
61 event_tryrecv Try Recv Event=%s
62 event_recv Recved Event=%s
61 event_tryrecv Try Recv Event=%s Event=%p
62 event_recv Recved Event=%s Event=%p
63 event_send Send Event=%s Event=%p
64 OS_DeleteMB MB=%p
65 OS_PutMail MB=%p Mail=%p
Expand Down
35 changes: 19 additions & 16 deletions SystemView_Src/Config/SEGGER_SYSVIEW_RTThread.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,17 @@ static void _cb_object_detach(struct rt_object* object)
}
}

void SEGGER_SYSVIEW_RecordObjectName(unsigned EventID, struct rt_object *object)
void SEGGER_SYSVIEW_RecordObject(unsigned EventID, struct rt_object *object)
{
U8 aPacket[SEGGER_SYSVIEW_INFO_SIZE + 4 * SEGGER_SYSVIEW_QUANTA_U32];
U8* pPayload;

pPayload = SEGGER_SYSVIEW_PREPARE_PACKET(aPacket); // Prepare the packet for SystemView
pPayload = SEGGER_SYSVIEW_EncodeString(pPayload, object->name, RT_NAME_MAX); // Add object name

if ((object->type & (~RT_Object_Class_Static)) == RT_Object_Class_Event)
pPayload = SEGGER_SYSVIEW_EncodeU32(pPayload, ((rt_event_t)object)->set);

SEGGER_SYSVIEW_SendPacket(&aPacket[0], pPayload, EventID); // Send the packet
}

Expand All @@ -183,19 +186,19 @@ static void _cb_object_trytake(struct rt_object *object)
switch (object->type & (~RT_Object_Class_Static))
{
case RT_Object_Class_Semaphore:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_SEM_TRYTAKE, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_SEM_TRYTAKE, object);
break;
case RT_Object_Class_Mutex:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_MUTEX_TRYTAKE, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_MUTEX_TRYTAKE, object);
break;
case RT_Object_Class_Event:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_EVENT_TRYTAKE, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_EVENT_TRYTAKE, object);
break;
case RT_Object_Class_MailBox:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_MAILBOX_TRYTAKE, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_MAILBOX_TRYTAKE, object);
break;
case RT_Object_Class_MessageQueue:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_QUEUE_TRYTAKE, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_QUEUE_TRYTAKE, object);
break;
}
}
Expand All @@ -206,19 +209,19 @@ static void _cb_object_take(struct rt_object *object)
switch (object->type & (~RT_Object_Class_Static))
{
case RT_Object_Class_Semaphore:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_SEM_TAKEN, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_SEM_TAKEN, object);
break;
case RT_Object_Class_Mutex:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_MUTEX_TAKEN, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_MUTEX_TAKEN, object);
break;
case RT_Object_Class_Event:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_EVENT_TAKEN, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_EVENT_TAKEN, object);
break;
case RT_Object_Class_MailBox:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_MAILBOX_TAKEN, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_MAILBOX_TAKEN, object);
break;
case RT_Object_Class_MessageQueue:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_QUEUE_TAKEN, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_QUEUE_TAKEN, object);
break;
}
}
Expand All @@ -228,19 +231,19 @@ static void _cb_object_put(struct rt_object *object)
switch (object->type & (~RT_Object_Class_Static))
{
case RT_Object_Class_Semaphore:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_SEM_RELEASE, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_SEM_RELEASE, object);
break;
case RT_Object_Class_Mutex:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_MUTEX_RELEASE, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_MUTEX_RELEASE, object);
break;
case RT_Object_Class_Event:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_EVENT_RELEASE, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_EVENT_RELEASE, object);
break;
case RT_Object_Class_MailBox:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_MAILBOX_RELEASE, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_MAILBOX_RELEASE, object);
break;
case RT_Object_Class_MessageQueue:
SEGGER_SYSVIEW_RecordObjectName(RTT_TRACE_ID_QUEUE_RELEASE, object);
SEGGER_SYSVIEW_RecordObject(RTT_TRACE_ID_QUEUE_RELEASE, object);
break;
}
}
Expand Down

0 comments on commit cc1a295

Please sign in to comment.