football_project_wo_output

Dependencies:   mbed

Fork of football_project by MZJ

Revision:
15:b86c4b798aa1
Parent:
14:76fb883a3cb8
Child:
16:3c873f2c8a27
--- a/main.cpp	Tue Jun 30 07:35:28 2015 +0000
+++ b/main.cpp	Tue Jun 30 21:45:21 2015 +0000
@@ -9,7 +9,10 @@
  *   Using
  *     rev 327 of BLE_API  
  *     rev 102 of nRF51822   w/ modification--See below
- *     rev 493 of mbed-src   w/ modification to targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/serial_api.c
+ *     rev  97 of mbed lib
+ *       corresponding to:
+ *         rev 493 of mbed-src   w/ modification to targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/serial_api.c
+ *         (Source no longer needed now that 
  *     so things compile properly.
  *
  *   Changed
@@ -91,9 +94,11 @@
 //  So we made our own versions of Serial and SerialBase (MySerial and MySerialBase)
 //  to not use serial_init() in serial_api.c, so flow control is setup correctly *
 //  MTSSerial now uses our MySerial instead of Serial, and now uses hw flow control by default *
-//  * We can't change the uart interrupt vector, so we comment-out the handler in
-//    serial_api.c, and rebuild the mbed lib for low-level hw flow control to work.
-//  NVIC_SetVector( UART0_IRQn, (uint32_t)My_UART0_IRQHandler );  // Might work.  TODO
+//  [* We can't change the uart interrupt vector, so we comment-out the handler in
+//     serial_api.c, and rebuild the mbed lib for low-level hw flow control to work.] - No need now.
+//  * Now using $Sub$$UART0_IRQHandler to override UART0_IRQHandler without needing to use lib source.
+//    NVIC_SetVector( UART0_IRQn, (uint32_t)My_UART0_IRQHandler );  // Might have worked--No need.
+//
 // MTSSerialFlowControl uses "manual" (non-hardware-low-level) flow control based on its
 //  internal buffer--Rx servicing usually is fast enough not to need hw flow control, so it's okay.
 //
@@ -473,4 +478,31 @@
     }
 }
 
+/**@brief Function for error handling, which is called when an error has occurred.
+ *
+ * @warning This handler is an example only and does not fit a final product. You need to analyze
+ *          how your product is supposed to react in case of error.
+ *
+ * @param[in] error_code  Error code supplied to the handler.
+ * @param[in] line_num    Line number where the handler is called.
+ * @param[in] p_file_name Pointer to the file name.
+ */
+void $Sub$$app_error_handler( uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name )
+{
+    // nrf_gpio_pin_set( ASSERT_LED_PIN_NO );
+    led1 = 1;
+
+    // This call can be used for debug purposes during application development.
+    // @note CAUTION: Activating this code will write the stack to flash on an error.
+    //                This function should NOT be used in a final product.
+    //                It is intended STRICTLY for development/debugging purposes.
+    //                The flash write will happen EVEN if the radio is active, thus interrupting
+    //                any communication.
+    //                Use with care. Uncomment the line below to use.
+    // ble_debug_assert_handler(error_code, line_num, p_file_name);
+
+    // On assert, the system can only recover with a reset.
+    NVIC_SystemReset();
+}
+
 /* EOF */