Skip to content

Commit aba3a23

Browse files
Bjoern Poetzschkedeadprogram
Bjoern Poetzschke
authored andcommitted
Rearrange switch case for get pin cfg
1 parent 5f30bbb commit aba3a23

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

src/machine/machine_atsamd21g18.go

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -406,61 +406,61 @@ func (p Pin) getPinCfg() uint8 {
406406
return uint8(sam.PORT.PINCFG1_0.Get()>>16) & 0xff
407407
case 35: // PB03
408408
return uint8(sam.PORT.PINCFG1_0.Get()>>24) & 0xff
409-
case 37: // PB04
409+
case 36: // PB04
410410
return uint8(sam.PORT.PINCFG1_4.Get()>>0) & 0xff
411-
case 38: // PB05
411+
case 37: // PB05
412412
return uint8(sam.PORT.PINCFG1_4.Get()>>8) & 0xff
413-
case 39: // PB06
413+
case 38: // PB06
414414
return uint8(sam.PORT.PINCFG1_4.Get()>>16) & 0xff
415-
case 40: // PB07
415+
case 39: // PB07
416416
return uint8(sam.PORT.PINCFG1_4.Get()>>24) & 0xff
417-
case 41: // PB08
417+
case 40: // PB08
418418
return uint8(sam.PORT.PINCFG1_8.Get()>>0) & 0xff
419-
case 42: // PB09
419+
case 41: // PB09
420420
return uint8(sam.PORT.PINCFG1_8.Get()>>8) & 0xff
421-
case 43: // PB10
421+
case 42: // PB10
422422
return uint8(sam.PORT.PINCFG1_8.Get()>>16) & 0xff
423-
case 44: // PB11
423+
case 43: // PB11
424424
return uint8(sam.PORT.PINCFG1_8.Get()>>24) & 0xff
425-
case 45: // PB12
425+
case 44: // PB12
426426
return uint8(sam.PORT.PINCFG1_12.Get()>>0) & 0xff
427-
case 46: // PB13
427+
case 45: // PB13
428428
return uint8(sam.PORT.PINCFG1_12.Get()>>8) & 0xff
429-
case 47: // PB14
429+
case 46: // PB14
430430
return uint8(sam.PORT.PINCFG1_12.Get()>>16) & 0xff
431-
case 48: // PB15
431+
case 47: // PB15
432432
return uint8(sam.PORT.PINCFG1_12.Get()>>24) & 0xff
433-
case 49: // PB16
433+
case 48: // PB16
434434
return uint8(sam.PORT.PINCFG1_16.Get()>>0) & 0xff
435-
case 50: // PB17
435+
case 49: // PB17
436436
return uint8(sam.PORT.PINCFG1_16.Get()>>8) & 0xff
437-
case 51: // PB18
437+
case 50: // PB18
438438
return uint8(sam.PORT.PINCFG1_16.Get()>>16) & 0xff
439-
case 52: // PB19
439+
case 51: // PB19
440440
return uint8(sam.PORT.PINCFG1_16.Get()>>24) & 0xff
441-
case 53: // PB20
441+
case 52: // PB20
442442
return uint8(sam.PORT.PINCFG1_20.Get()>>0) & 0xff
443-
case 54: // PB21
443+
case 53: // PB21
444444
return uint8(sam.PORT.PINCFG1_20.Get()>>8) & 0xff
445-
case 55: // PB22
445+
case 54: // PB22
446446
return uint8(sam.PORT.PINCFG1_20.Get()>>16) & 0xff
447-
case 56: // PB23
447+
case 55: // PB23
448448
return uint8(sam.PORT.PINCFG1_20.Get()>>24) & 0xff
449-
case 57: // PB24
449+
case 56: // PB24
450450
return uint8(sam.PORT.PINCFG1_24.Get()>>0) & 0xff
451-
case 58: // PB25
451+
case 57: // PB25
452452
return uint8(sam.PORT.PINCFG1_24.Get()>>8) & 0xff
453-
case 59: // PB26
453+
case 58: // PB26
454454
return uint8(sam.PORT.PINCFG1_24.Get()>>16) & 0xff
455-
case 60: // PB27
455+
case 59: // PB27
456456
return uint8(sam.PORT.PINCFG1_24.Get()>>24) & 0xff
457-
case 61: // PB28
457+
case 60: // PB28
458458
return uint8(sam.PORT.PINCFG1_28.Get()>>0) & 0xff
459-
case 62: // PB29
459+
case 61: // PB29
460460
return uint8(sam.PORT.PINCFG1_28.Get()>>8) & 0xff
461-
case 63: // PB30
461+
case 62: // PB30
462462
return uint8(sam.PORT.PINCFG1_28.Get()>>16) & 0xff
463-
case 64: // PB31
463+
case 63: // PB31
464464
return uint8(sam.PORT.PINCFG1_28.Get()>>24) & 0xff
465465
default:
466466
return 0

0 commit comments

Comments
 (0)