Skip to content

Commit

Permalink
New function for setting up timer
Browse files Browse the repository at this point in the history
  • Loading branch information
pichenettes committed Apr 20, 2012
1 parent c4f5aa1 commit f82b0ca
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ struct PwmChannel {
static inline void set_frequency(uint16_t f) {
OCR1A = f;
}
static inline void set_frequency_pulse(uint16_t f) {
OCR1A = f;
OCR1B = f - (f >> 2);
}
};

struct NoPwmChannel {
Expand Down

0 comments on commit f82b0ca

Please sign in to comment.