Naze32 clone with Frysky receiver
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

TimerEvent.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* mbed Microcontroller Library
  2. * Copyright (c) 2006-2013 ARM Limited
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef MBED_TIMEREVENT_H
  17. #define MBED_TIMEREVENT_H
  18. #include "ticker_api.h"
  19. #include "us_ticker_api.h"
  20. namespace mbed {
  21. /** Base abstraction for timer interrupts
  22. */
  23. class TimerEvent {
  24. public:
  25. TimerEvent();
  26. TimerEvent(const ticker_data_t *data);
  27. /** The handler registered with the underlying timer interrupt
  28. */
  29. static void irq(uint32_t id);
  30. /** Destruction removes it...
  31. */
  32. virtual ~TimerEvent();
  33. protected:
  34. // The handler called to service the timer event of the derived class
  35. virtual void handler() = 0;
  36. // insert in to linked list
  37. void insert(timestamp_t timestamp);
  38. // remove from linked list, if in it
  39. void remove();
  40. ticker_event_t event;
  41. const ticker_data_t *_ticker_data;
  42. };
  43. } // namespace mbed
  44. #endif