@@ -17,7 +17,7 @@ const timer01Dividers = {
1717 4 : 256 ,
1818 5 : 1024 ,
1919 6 : 0 , // TODO: External clock source on T0 pin. Clock on falling edge.
20- 7 : 0 // TODO: External clock source on T0 pin. Clock on rising edge.
20+ 7 : 0 , // TODO: External clock source on T0 pin. Clock on rising edge.
2121} ;
2222
2323const TOV = 1 ;
@@ -78,7 +78,7 @@ export const timer0Config: AVRTimerConfig = {
7878 TCCRB : 0x45 ,
7979 TCCRC : 0 , // not available
8080 TIMSK : 0x6e ,
81- dividers : timer01Dividers
81+ dividers : timer01Dividers ,
8282} ;
8383
8484export const timer1Config : AVRTimerConfig = {
@@ -96,7 +96,7 @@ export const timer1Config: AVRTimerConfig = {
9696 TCCRB : 0x81 ,
9797 TCCRC : 0x82 ,
9898 TIMSK : 0x6f ,
99- dividers : timer01Dividers
99+ dividers : timer01Dividers ,
100100} ;
101101
102102export const timer2Config : AVRTimerConfig = {
@@ -122,8 +122,8 @@ export const timer2Config: AVRTimerConfig = {
122122 4 : 64 ,
123123 5 : 128 ,
124124 6 : 256 ,
125- 7 : 1024
126- }
125+ 7 : 1024 ,
126+ } ,
127127} ;
128128
129129/* All the following types and constants are related to WGM (Waveform Generation Mode) bits: */
@@ -133,19 +133,19 @@ enum TimerMode {
133133 CTC ,
134134 FastPWM ,
135135 PWMPhaseFrequencyCorrect ,
136- Reserved
136+ Reserved ,
137137}
138138
139139enum TOVUpdateMode {
140140 Max ,
141141 Top ,
142- Bottom
142+ Bottom ,
143143}
144144
145145enum OCRUpdateMode {
146146 Immediate ,
147147 Top ,
148- Bottom
148+ Bottom ,
149149}
150150
151151const TopOCRA = 1 ;
@@ -162,7 +162,7 @@ const wgmModes8Bit: WGMConfig[] = [
162162 /*4*/ [ TimerMode . Reserved , 0xff , OCRUpdateMode . Immediate , TOVUpdateMode . Max ] ,
163163 /*5*/ [ TimerMode . PWMPhaseCorrect , TopOCRA , OCRUpdateMode . Top , TOVUpdateMode . Bottom ] ,
164164 /*6*/ [ TimerMode . Reserved , 0xff , OCRUpdateMode . Immediate , TOVUpdateMode . Max ] ,
165- /*7*/ [ TimerMode . FastPWM , TopOCRA , OCRUpdateMode . Bottom , TOVUpdateMode . Top ]
165+ /*7*/ [ TimerMode . FastPWM , TopOCRA , OCRUpdateMode . Bottom , TOVUpdateMode . Top ] ,
166166] ;
167167
168168// Table 16-4 in the datasheet
@@ -182,7 +182,7 @@ const wgmModes16Bit: WGMConfig[] = [
182182 /*12*/ [ TimerMode . CTC , TopICR , OCRUpdateMode . Immediate , TOVUpdateMode . Max ] ,
183183 /*13*/ [ TimerMode . Reserved , 0xffff , OCRUpdateMode . Immediate , TOVUpdateMode . Max ] ,
184184 /*14*/ [ TimerMode . FastPWM , TopICR , OCRUpdateMode . Bottom , TOVUpdateMode . Top ] ,
185- /*15*/ [ TimerMode . FastPWM , TopOCRA , OCRUpdateMode . Bottom , TOVUpdateMode . Top ]
185+ /*15*/ [ TimerMode . FastPWM , TopOCRA , OCRUpdateMode . Bottom , TOVUpdateMode . Top ] ,
186186] ;
187187
188188export class AVRTimer {
0 commit comments