Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and apply interrupt helper macros #6400

Merged
merged 3 commits into from
Apr 20, 2017

Conversation

thinkyhead
Copy link
Member

Add some macros and enumerations to make interrupt setup code easier to read:

  • enum WaveGenMode for wave generation modes
  • enum CompareMode for compare modes
  • enum ClockSource for clock sources
  • SET_WGM(I,V) to set the Wave Generation Mode for an interrupt
  • SET_CS(I,V) to set the Clock Source for an interrupt
  • SET_COM(I,C,V) to set the Compare Mode for an interrupt + channel
  • SET_COMA(I,V) / SET_COMB(I,V) are short for SET_COM(I,A,V) / SET_COM(I,B,V)
  • SET_COMS(I,V1,V2) is short for SET_COMA(I,V1), SET_COMB(I,V2)

The compiler should generate code that combines operations. These are mainly to make it easier to quickly set and change these options when developing interrupt code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants