aboutsummaryrefslogtreecommitdiff
path: root/src/peripherals/timer.ts
diff options
context:
space:
mode:
authorUri Shaked2020-04-27 21:59:13 +0300
committerUri Shaked2020-04-27 21:59:13 +0300
commitc792b8c5938bc6331dc4869c6c51dc01cde75641 (patch)
treed70b95699ef73cdefd0d21417e14bb85c51dff27 /src/peripherals/timer.ts
parentchore(deps): prettier 2.0 (diff)
downloadavr8js-c792b8c5938bc6331dc4869c6c51dc01cde75641.tar.gz
avr8js-c792b8c5938bc6331dc4869c6c51dc01cde75641.tar.bz2
avr8js-c792b8c5938bc6331dc4869c6c51dc01cde75641.zip
style: reformat code with prettier 2.x
prettier rules have changed since we upgraded to 2.x
Diffstat (limited to 'src/peripherals/timer.ts')
-rw-r--r--src/peripherals/timer.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/peripherals/timer.ts b/src/peripherals/timer.ts
index ac344ef..ebd7b58 100644
--- a/src/peripherals/timer.ts
+++ b/src/peripherals/timer.ts
@@ -17,7 +17,7 @@ const timer01Dividers = {
4: 256,
5: 1024,
6: 0, // TODO: External clock source on T0 pin. Clock on falling edge.
- 7: 0 // TODO: External clock source on T0 pin. Clock on rising edge.
+ 7: 0, // TODO: External clock source on T0 pin. Clock on rising edge.
};
const TOV = 1;
@@ -78,7 +78,7 @@ export const timer0Config: AVRTimerConfig = {
TCCRB: 0x45,
TCCRC: 0, // not available
TIMSK: 0x6e,
- dividers: timer01Dividers
+ dividers: timer01Dividers,
};
export const timer1Config: AVRTimerConfig = {
@@ -96,7 +96,7 @@ export const timer1Config: AVRTimerConfig = {
TCCRB: 0x81,
TCCRC: 0x82,
TIMSK: 0x6f,
- dividers: timer01Dividers
+ dividers: timer01Dividers,
};
export const timer2Config: AVRTimerConfig = {
@@ -122,8 +122,8 @@ export const timer2Config: AVRTimerConfig = {
4: 64,
5: 128,
6: 256,
- 7: 1024
- }
+ 7: 1024,
+ },
};
/* All the following types and constants are related to WGM (Waveform Generation Mode) bits: */
@@ -133,19 +133,19 @@ enum TimerMode {
CTC,
FastPWM,
PWMPhaseFrequencyCorrect,
- Reserved
+ Reserved,
}
enum TOVUpdateMode {
Max,
Top,
- Bottom
+ Bottom,
}
enum OCRUpdateMode {
Immediate,
Top,
- Bottom
+ Bottom,
}
const TopOCRA = 1;
@@ -162,7 +162,7 @@ const wgmModes8Bit: WGMConfig[] = [
/*4*/ [TimerMode.Reserved, 0xff, OCRUpdateMode.Immediate, TOVUpdateMode.Max],
/*5*/ [TimerMode.PWMPhaseCorrect, TopOCRA, OCRUpdateMode.Top, TOVUpdateMode.Bottom],
/*6*/ [TimerMode.Reserved, 0xff, OCRUpdateMode.Immediate, TOVUpdateMode.Max],
- /*7*/ [TimerMode.FastPWM, TopOCRA, OCRUpdateMode.Bottom, TOVUpdateMode.Top]
+ /*7*/ [TimerMode.FastPWM, TopOCRA, OCRUpdateMode.Bottom, TOVUpdateMode.Top],
];
// Table 16-4 in the datasheet
@@ -182,7 +182,7 @@ const wgmModes16Bit: WGMConfig[] = [
/*12*/ [TimerMode.CTC, TopICR, OCRUpdateMode.Immediate, TOVUpdateMode.Max],
/*13*/ [TimerMode.Reserved, 0xffff, OCRUpdateMode.Immediate, TOVUpdateMode.Max],
/*14*/ [TimerMode.FastPWM, TopICR, OCRUpdateMode.Bottom, TOVUpdateMode.Top],
- /*15*/ [TimerMode.FastPWM, TopOCRA, OCRUpdateMode.Bottom, TOVUpdateMode.Top]
+ /*15*/ [TimerMode.FastPWM, TopOCRA, OCRUpdateMode.Bottom, TOVUpdateMode.Top],
];
export class AVRTimer {