Skip to content

Commit

Permalink
Implement activity heart beat
Browse files Browse the repository at this point in the history
- Add call to events heart beat on Events_WaitForEvents loop.
- Add compiler defines for EVENTS_HEART_BEAT on target_HAL for all targets
- Add commented define for events heart beat on all targets.

Signed-off-by: José Simões <[email protected]>
  • Loading branch information
josesimoes committed Mar 14, 2019
1 parent b872200 commit ba78b43
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 0 deletions.
15 changes: 15 additions & 0 deletions targets/CMSIS-OS/ChibiOS/Include/targetHAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@

#endif // !defined(BUILD_RTM)


/////////////////////////////////////////////////////////////////////////////////////////////////////
// DEBUGGER HELPER //
// The line bellow is meant to be used as helper on checking that the execution engine is running. //
// This can be inferred by checking if Events_WaitForEvents loop is running. //
// The implementation should is to be provided by each target at target_common.h.in //
////////////////////////////////////////////////////////////////////////////////////////////////////
#if defined(BUILD_RTM)
#define EVENTS_HEART_BEAT
#else
#ifndef EVENTS_HEART_BEAT
#define EVENTS_HEART_BEAT __NOP()
#endif // EVENTS_HEART_BEAT
#endif

#define NANOCLR_STOP() CPU_Reset();

extern int HeapBegin;
Expand Down
4 changes: 4 additions & 0 deletions targets/CMSIS-OS/ChibiOS/MBN_QUAIL/target_common.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@

/////////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////
//#define EVENTS_HEART_BEAT palToggleLine(GPIOE_LED1)
/////////////////////////////////////

#endif /* _TARGET_COMMON_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@
#define WP_PACKET_SIZE 256U
//////////////////////////////////////////////

/////////////////////////////////////
//#define EVENTS_HEART_BEAT palToggleLine(GPIOA_LED_GREEN)
/////////////////////////////////////

#endif /* _TARGET_COMMON_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@

/////////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////
//#define EVENTS_HEART_BEAT palToggleLine(GPIOG_LED3_GREEN)
/////////////////////////////////////

#endif /* _TARGET_COMMON_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@
#define PLATFORM_HAS_RNG TRUE
/////////////////////////////////////

/////////////////////////////////////
//#define EVENTS_HEART_BEAT palToggleLine(LINE_LED2_GREEN)
/////////////////////////////////////

#endif /* _TARGET_COMMON_H_ */
2 changes: 2 additions & 0 deletions targets/CMSIS-OS/ChibiOS/nanoCLR/targetPAL_Events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ uint32_t Events_WaitForEvents( uint32_t powerLevel, uint32_t wakeupSystemEvents,

while(true)
{
EVENTS_HEART_BEAT;

uint32_t events = Events_MaskedRead( wakeupSystemEvents );
if(events)
{
Expand Down
15 changes: 15 additions & 0 deletions targets/FreeRTOS_ESP32/ESP32_WROOM_32/Include/targetHAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ extern portMUX_TYPE globalLockMutex;

#define NANOCLR_STOP() HARD_BREAKPOINT()


/////////////////////////////////////////////////////////////////////////////////////////////////////
// DEBUGGER HELPER //
// The line bellow is meant to be used as helper on checking that the execution engine is running. //
// This can be inferred by checking if Events_WaitForEvents loop is running. //
// The implementation should is to be provided by each target at target_common.h.in //
////////////////////////////////////////////////////////////////////////////////////////////////////
#if defined(BUILD_RTM)
#define EVENTS_HEART_BEAT
#else
#ifndef EVENTS_HEART_BEAT
#define EVENTS_HEART_BEAT __NOP()
#endif // EVENTS_HEART_BEAT
#endif

extern int HeapBegin;
extern int HeapEnd;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ uint32_t Events_WaitForEvents( uint32_t powerLevel, uint32_t wakeupSystemEvents,

while(true)
{
EVENTS_HEART_BEAT;

uint32_t events = Events_MaskedRead( wakeupSystemEvents );
if(events)
{
Expand Down
3 changes: 3 additions & 0 deletions targets/FreeRTOS_ESP32/ESP32_WROOM_32/target_common.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@

/////////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////
// #define EVENTS_HEART_BEAT __NOP()
/////////////////////////////////////

#endif /* _TARGET_COMMON_H_ */

0 comments on commit ba78b43

Please sign in to comment.