Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of UtilityLib by
Diff: Utility.h
- Revision:
- 5:9cd633b79b23
- Parent:
- 4:28f50e540872
- Child:
- 6:f9e2de3fcd8a
--- a/Utility.h Tue Mar 11 21:13:48 2014 +0000 +++ b/Utility.h Tue Mar 11 22:16:54 2014 +0000 @@ -14,13 +14,13 @@ public: /** * Constructs a Utility object, which manages LEDs, serial communication, and other helper methods. - * @param green_led_pin pin for green user LED - * @param red_led_pin pin for red user LED + * @param green_led pointer to a DigitalOut for green LED blinking + * @param red_led pointer to a DigitalOut for green LED blinking * @param serial_tx_pin pin for the UART TX * @param serial_rx_pin pin for the UART RX * @param enableSerialInterrupts if true, allows interrupt handlers on the serial port */ - Utility(PinName green_led_pin, PinName red_led_pin, PinName serial_tx_pin, PinName serial_rx_pin, int baudrate, bool enableSerialInterrupts); + Utility(DigitalOut *green_led, DigitalOut *red_led, PinName serial_tx_pin, PinName serial_rx_pin, int baudrate, bool enableSerialInterrupts); /** * Utility destructor. @@ -108,8 +108,6 @@ bool haveRxSerialData(); Serial console; - DigitalOut green_led; - DigitalOut red_led; private: /** @@ -136,6 +134,12 @@ inline void __disable_uart_irq(); inline void __enable_uart_irq(); + DigitalOut *__green_led; + DigitalOut *__red_led; + + bool __valid_green; + bool __valid_red; + bool __interrupts_en; FunctionPointer *__user_fptr; //User callback function that is invoked in __console_rx_ISR()