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.
Diff: CDC.cpp
- Revision:
- 13:968af0520530
- Parent:
- 12:4194c47ca60b
- Child:
- 14:3f4098e94c29
--- a/CDC.cpp Fri Jan 29 20:27:37 2016 +0000 +++ b/CDC.cpp Sat Jan 30 21:03:52 2016 +0000 @@ -57,6 +57,7 @@ /** I/O: **/ DigitalOut led1(LED1, 0); DigitalOut led2(LED2, 0); +DigitalOut enable_transceiver(p19); /** Timers: **/ Timer playback; @@ -66,8 +67,19 @@ * PUBLIC METHODS ******************************************************************************/ +/** Enables CAN traciever transmit **/ +void CDC::enable() { + enable_transceiver = 0; //active +} + +/** Disables CAN traciever transmit **/ +void CDC::disable() { + enable_transceiver = 1; //sleep +} + /** Initializes CDC **/ void CDC::init() { + enable(); can.frequency(47619); printf("CAN Frequency set\r\n"); CAN_wrFilter(1, IHU_BUTTONS);