Skip to content

Commit c792b8c

Browse files
committed
style: reformat code with prettier 2.x
prettier rules have changed since we upgraded to 2.x
1 parent 38be328 commit c792b8c

File tree

12 files changed

+39
-39
lines changed

12 files changed

+39
-39
lines changed

demo/src/compile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export async function buildHex(source: string) {
1212
mode: 'cors',
1313
cache: 'no-cache',
1414
headers: {
15-
'Content-Type': 'application/json'
15+
'Content-Type': 'application/json',
1616
},
17-
body: JSON.stringify({ sketch: source })
17+
body: JSON.stringify({ sketch: source }),
1818
});
1919
return (await resp.json()) as HexiResult;
2020
}

demo/src/execute.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
portBConfig,
1010
portCConfig,
1111
portDConfig,
12-
usart0Config
12+
usart0Config,
1313
} from 'avr8js';
1414
import { loadHex } from './intelhex';
1515
import { MicroTaskScheduler } from './task-scheduler';

demo/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ void loop() {
2929
declare const window: any; // eslint-disable-line @typescript-eslint/no-explicit-any
3030
declare const monaco: any; // eslint-disable-line @typescript-eslint/no-explicit-any
3131
window.require.config({
32-
paths: { vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.20.0/min/vs' }
32+
paths: { vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.20.0/min/vs' },
3333
});
3434
window.require(['vs/editor/editor.main'], () => {
3535
editor = monaco.editor.create(document.querySelector('.code-editor'), {
3636
value: EditorHistoryUtil.getValue() || BLINK_CODE,
3737
language: 'cpp',
38-
minimap: { enabled: false }
38+
minimap: { enabled: false },
3939
});
4040
});
4141

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export {
2323
portJConfig,
2424
portKConfig,
2525
portLConfig,
26-
PinState
26+
PinState,
2727
} from './peripherals/gpio';
2828
export { AVRUSART, usart0Config } from './peripherals/usart';
2929
export * from './peripherals/twi';

src/peripherals/gpio.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,74 +20,74 @@ export type GPIOListener = (value: u8, oldValue: u8) => void;
2020
export const portAConfig: AVRPortConfig = {
2121
PIN: 0x20,
2222
DDR: 0x21,
23-
PORT: 0x22
23+
PORT: 0x22,
2424
};
2525

2626
export const portBConfig: AVRPortConfig = {
2727
PIN: 0x23,
2828
DDR: 0x24,
29-
PORT: 0x25
29+
PORT: 0x25,
3030
};
3131

3232
export const portCConfig: AVRPortConfig = {
3333
PIN: 0x26,
3434
DDR: 0x27,
35-
PORT: 0x28
35+
PORT: 0x28,
3636
};
3737

3838
export const portDConfig: AVRPortConfig = {
3939
PIN: 0x29,
4040
DDR: 0x2a,
41-
PORT: 0x2b
41+
PORT: 0x2b,
4242
};
4343

4444
export const portEConfig: AVRPortConfig = {
4545
PIN: 0x2c,
4646
DDR: 0x2d,
47-
PORT: 0x2e
47+
PORT: 0x2e,
4848
};
4949

5050
export const portFConfig: AVRPortConfig = {
5151
PIN: 0x2f,
5252
DDR: 0x30,
53-
PORT: 0x31
53+
PORT: 0x31,
5454
};
5555

5656
export const portGConfig: AVRPortConfig = {
5757
PIN: 0x32,
5858
DDR: 0x33,
59-
PORT: 0x34
59+
PORT: 0x34,
6060
};
6161

6262
export const portHConfig: AVRPortConfig = {
6363
PIN: 0x100,
6464
DDR: 0x101,
65-
PORT: 0x102
65+
PORT: 0x102,
6666
};
6767

6868
export const portJConfig: AVRPortConfig = {
6969
PIN: 0x103,
7070
DDR: 0x104,
71-
PORT: 0x105
71+
PORT: 0x105,
7272
};
7373

7474
export const portKConfig: AVRPortConfig = {
7575
PIN: 0x106,
7676
DDR: 0x107,
77-
PORT: 0x108
77+
PORT: 0x108,
7878
};
7979

8080
export const portLConfig: AVRPortConfig = {
8181
PIN: 0x109,
8282
DDR: 0x10a,
83-
PORT: 0x10b
83+
PORT: 0x10b,
8484
};
8585

8686
export enum PinState {
8787
Low,
8888
High,
8989
Input,
90-
InputPullUp
90+
InputPullUp,
9191
}
9292

9393
export class AVRIOPort {

src/peripherals/timer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ describe('timer', () => {
214214
'LDI r16, 0x30', // TCNT <- 0x30
215215
'OUT 0x26, r16',
216216
'NOP',
217-
'IN r17, 0x26' // r17 <- TCNT
217+
'IN r17, 0x26', // r17 <- TCNT
218218
];
219219
loadProgram(...program);
220220
const timer = new AVRTimer(cpu, timer0Config);

src/peripherals/timer.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

2323
const 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

8484
export 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

102102
export 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

139139
enum TOVUpdateMode {
140140
Max,
141141
Top,
142-
Bottom
142+
Bottom,
143143
}
144144

145145
enum OCRUpdateMode {
146146
Immediate,
147147
Top,
148-
Bottom
148+
Bottom,
149149
}
150150

151151
const 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

188188
export class AVRTimer {

src/peripherals/twi.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ describe('TWI', () => {
176176
stop: jest.fn(),
177177
connectToSlave: jest.fn(),
178178
writeByte: jest.fn(),
179-
readByte: jest.fn()
179+
readByte: jest.fn(),
180180
};
181181

182182
// Step 1: wait for start condition
@@ -344,7 +344,7 @@ describe('TWI', () => {
344344
stop: jest.fn(),
345345
connectToSlave: jest.fn(),
346346
writeByte: jest.fn(),
347-
readByte: jest.fn()
347+
readByte: jest.fn(),
348348
};
349349

350350
// Step 1: wait for start condition

src/peripherals/twi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const twiConfig: TWIConfig = {
6565
TWAR: 0xba,
6666
TWDR: 0xbb,
6767
TWCR: 0xbc,
68-
TWAMR: 0xbd
68+
TWAMR: 0xbd,
6969
};
7070

7171
// A simple TWI Event Handler that sends a NACK for all events

src/peripherals/usart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const usart0Config: USARTConfig = {
2424
UCSRC: 0xc2,
2525
UBRRL: 0xc4,
2626
UBRRH: 0xc5,
27-
UDR: 0xc6
27+
UDR: 0xc6,
2828
};
2929

3030
export type USARTTransmitCallback = (value: u8) => void;

0 commit comments

Comments
 (0)