Add abort() implementation

Also reduces the IRAM footprint of the fatal exception handler, as only
the prelude (which disables interrupts & enables the flash mapping) is
in IRAM now.

Closes #54, relevant to #133.
This commit is contained in:
Angus Gratton 2016-05-07 18:21:13 +10:00
parent cf350efd8a
commit 36886412e6
9 changed files with 106 additions and 33 deletions

View file

@ -85,7 +85,7 @@ void tls_server_task(void *pvParameters)
strlen(pers))) != 0)
{
printf(" failed\n ! mbedtls_ctr_drbg_seed returned %d\n", ret);
while(1) {} /* todo: replace with abort() */
abort();
}
printf(" ok\n");
@ -99,7 +99,7 @@ void tls_server_task(void *pvParameters)
if(ret < 0)
{
printf(" failed\n ! mbedtls_x509_crt_parse returned -0x%x\n\n", -ret);
while(1) {} /* todo: replace with abort() */
abort();
}
printf(" ok (%d skipped)\n", ret);
@ -109,7 +109,7 @@ void tls_server_task(void *pvParameters)
if(ret != 0)
{
printf(" failed\n ! mbedtls_pk_parse_key returned - 0x%x\n\n", -ret);
while(1) { } /*todo: replace with abort() */
abort();
}
printf(" ok\n");
@ -134,7 +134,7 @@ void tls_server_task(void *pvParameters)
if( ( ret = mbedtls_ssl_conf_own_cert( &conf, &srvcert, &pkey ) ) != 0 )
{
printf( " failed\n ! mbedtls_ssl_conf_own_cert returned %d\n\n", ret );
while(1) { }
abort();
}
mbedtls_ssl_conf_rng(&conf, mbedtls_ctr_drbg_random, &ctr_drbg);