You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/05/18 11:13:41 UTC

[GitHub] mkiiskila commented on a change in pull request #1110: hal; add convenience routine to return reason for reset as string.

mkiiskila commented on a change in pull request #1110: hal; add convenience routine to return reason for reset as string.
URL: https://github.com/apache/mynewt-core/pull/1110#discussion_r189236761
 
 

 ##########
 File path: hw/hal/src/hal_common.c
 ##########
 @@ -57,3 +57,27 @@ hal_spi_data_mode_breakout(uint8_t data_mode, int *out_cpol, int *out_cpha)
         return -1;
     }
 }
+
+const char *
+hal_reset_cause_str(void)
+{
+    enum hal_reset_reason cause;
+
+    cause = hal_reset_cause();
+    switch (cause) {
 
 Review comment:
   I often use local variables to make the code easier to read. It's up to compiler to optimize them out :)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services