From 4c8d2602322862e2031ddebf28de9b7a873cf608 Mon Sep 17 00:00:00 2001 From: Hoernchen Date: Fri, 7 Jun 2013 18:50:03 +0200 Subject: [PATCH] make sure the m0 is really running/stopped --- lib/lpc43xx/ipc.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/lpc43xx/ipc.c b/lib/lpc43xx/ipc.c index 57d6935f..e43c0052 100644 --- a/lib/lpc43xx/ipc.c +++ b/lib/lpc43xx/ipc.c @@ -30,15 +30,10 @@ void ipc_halt_m0(void) rst_active_status1 = RESET_ACTIVE_STATUS1; /* If the M0 has reset not asserted, halt it... */ - if( (rst_active_status1 & RESET_CTRL1_M0APP_RST) ) + while( (rst_active_status1 & RESET_CTRL1_M0APP_RST) ) { RESET_CTRL1 = ((~rst_active_status1) | RESET_CTRL1_M0APP_RST); rst_active_status1 = RESET_ACTIVE_STATUS1; - /* Check again */ - if( (rst_active_status1 & RESET_CTRL1_M0APP_RST) ) - { - RESET_CTRL1 = ((~rst_active_status1) | RESET_CTRL1_M0APP_RST); - } } } @@ -56,15 +51,10 @@ void ipc_start_m0(u32 cm0_baseaddr) /* If the M0 is being held in reset, release it */ /* 1 = no reset, 0 = reset */ - if( !(rst_active_status1 & RESET_CTRL1_M0APP_RST) ) + while( !(rst_active_status1 & RESET_CTRL1_M0APP_RST) ) { RESET_CTRL1 = ((~rst_active_status1) & (~RESET_CTRL1_M0APP_RST)); rst_active_status1 = RESET_ACTIVE_STATUS1; - /* Check again */ - if( !(rst_active_status1 & RESET_CTRL1_M0APP_RST) ) - { - RESET_CTRL1 = ((~rst_active_status1) & (~RESET_CTRL1_M0APP_RST)); - } } }