jamescpp

Untitled

May 11th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. template<typename io_pin_tt>
  2. struct led{
  3.     static inline void on(){
  4.         io_pin_tt::set(1);
  5.     }
  6.  
  7.     static inline void off(){
  8.         io_pin_tt::set(0);
  9.     }
  10. };
  11.  
  12. using power_led = led<cpu::io::pin<13>>;
  13. using status_led = led<cpu::io::pin<1>>;
  14.  
  15.  
  16. //...
  17. power_led::on();
  18.  
  19. if(blaaa)
  20.     status_led::on();
  21.  
  22. power_led::off
  23. //...
Advertisement
Add Comment
Please, Sign In to add comment