mbed libraries for KL25Z

Dependents:   FRDM_RGBLED

Timeout.h

Committer:
emilmont
Date:
2012-11-09
Revision:
8:c14af7958ef5
Parent:
0:8024c367e29f
Child:
9:663789d7729f

File content as of revision 8:c14af7958ef5:

/* mbed Microcontroller Library - Timeout
 * Copyright (c) 2007-2009 ARM Limited. All rights reserved.
 */
#ifndef MBED_TIMEOUT_H
#define MBED_TIMEOUT_H

#include "Ticker.h"

namespace mbed {

/** A Timeout is used to call a function at a point in the future
 *
 * You can use as many seperate Timeout objects as you require. 
 *
 * Example:
 * @code
 * // Blink until timeout.
 *
 * #include "mbed.h"
 * 
 * Timeout timeout;
 * DigitalOut led(LED1);
 * 
 * int on = 1;
 * 
 * void attimeout() {
 *     on = 0;
 * }
 * 
 * int main() {
 *     timeout.attach(&attimeout, 5);
 *     while(on) {
 *         led = !led;
 *         wait(0.2);
 *     }
 * }
 * @endcode
 */
class Timeout : public Ticker {

protected:
    virtual void handler();
};

} // namespace mbed

#endif