File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const offsetCounter = (
2020) => cpuToTcnt ( tcntToCpu ( counter , top ) + offset , top , isDoubleSlope )
2121
2222const getTimerLength = ( top : number , isDoubleSlope : boolean ) => {
23- return isDoubleSlope ? top * 2 : top
23+ return isDoubleSlope ? top * 2 : top + 1
2424}
2525const cpuToTcnt = ( cpu : number , top : number , isDoubleSlope : boolean ) => {
2626 while ( cpu < 0 && top > 0 ) cpu += top
@@ -78,7 +78,7 @@ export default function simTimer({
7878} : Props ) {
7979 const isDoubleSlope = [ 'PCPWM' , 'PFCPWM' ] . includes ( timerMode )
8080 const timerLength = getTimerLength ( top , isDoubleSlope )
81- const prescaledCPUEnd = timerLength * 4 + 2
81+ const prescaledCPUEnd = timerLength * 4
8282 const results = {
8383 t : [ ] as number [ ] ,
8484 cpu : [ ] as number [ ] ,
You can’t perform that action at this time.
0 commit comments