mirror of https://github.com/ARMmbed/mbed-os.git
Changed behaviour of mbed_asert to use mbed_error instead of mbed_die.
parent
a0a9b54e97
commit
c3e7ddbb10
|
@ -13,15 +13,21 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
#include "platform/mbed_assert.h"
|
|
||||||
#include "device.h"
|
|
||||||
|
|
||||||
#include "platform/mbed_interface.h"
|
#include <string.h>
|
||||||
|
#include "platform/mbed_assert.h"
|
||||||
|
|
||||||
#include "platform/mbed_critical.h"
|
#include "platform/mbed_critical.h"
|
||||||
|
#include "platform/mbed_error.h"
|
||||||
|
|
||||||
void mbed_assert_internal(const char *expr, const char *file, int line)
|
void mbed_assert_internal(const char *expr, const char *file, int line)
|
||||||
{
|
{
|
||||||
core_util_critical_section_enter();
|
core_util_critical_section_enter();
|
||||||
mbed_error_printf("mbed assertation failed: %s, file: %s, line %d \n", expr, file, line);
|
|
||||||
mbed_die();
|
const char error_description[] = "Mbed assertation failed ";
|
||||||
|
unsigned error_message_length = strlen(error_description) + strlen(expr) + 1;
|
||||||
|
char error_message[error_message_length];
|
||||||
|
snprintf(error_message, error_message_length, "%s%s", error_description, expr);
|
||||||
|
|
||||||
|
mbed_error(MBED_ERROR_INVALID_ARGUMENT, error_message, 0, file, line);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue