15:21 9nov

Dependencies:   mbed mbedtls

Revision:
1:c8f7fe71d151
Parent:
0:5d1b6c97e2fe
Child:
2:cee7ee508f77
diff -r 5d1b6c97e2fe -r c8f7fe71d151 main.cpp
--- a/main.cpp	Fri Nov 09 09:50:56 2018 +0000
+++ b/main.cpp	Fri Nov 09 09:56:53 2018 +0000
@@ -2,7 +2,12 @@
 #include "mbedtls/pk.h"
 #include "mbedtls/ctr_drbg.h"
 
+PwmOut r(LED_RED);
+PwmOut g(LED_GREEN);
+PwmOut b(LED_BLUE);
 
+r = g = b = 1;
+g = 0;
 int main(){
     int ret = 0;
     mbedtls_pk_context pk;
@@ -22,6 +27,8 @@
     if( ( ret = mbedtls_pk_parse_public_key( &pk, key,sizeof(key)) ) != 0 )
     {
         printf( " failed\n  ! mbedtls_pk_parse_public_key returned -0x%04x\n", -ret );
+        g = b = 1;
+        r = 0;
         goto exit;
     }
     
@@ -41,6 +48,8 @@
                                     mbedtls_ctr_drbg_random, &ctr_drbg ) ) != 0 )
     {
         printf( " failed\n  ! mbedtls_pk_encrypt returned -0x%04x\n", -ret );
+        r = g = 1;
+        b = 0;
         goto exit;
     }
     exit: