File tree Expand file tree Collapse file tree 1 file changed +20
-20
lines changed Expand file tree Collapse file tree 1 file changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -628,28 +628,28 @@ Samba::chipInfo()
628
628
void
629
629
Samba::reset (void )
630
630
{
631
-
632
- uint32_t chipId = Samba::chipId ();
633
-
634
- // If it's SAMD21G18 or SAMD21J18
635
- if (chipId == 0x10010000 || chipId == 0x10010005 ) {
636
- // The following write resets the controller.
637
- // More info : http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0484c/index.html
638
- writeWord (0xE000ED0C ,0x05FA0004 );
639
- return ;
640
- }
641
-
642
- // Now do the rest
643
-
644
-
645
- if (chipId != 0x285e0a60 ) {
646
- printf (" Reset not supported for this CPU" );
647
- return ;
648
- }
631
+ printf (" CPU reset.\n " );
649
632
633
+ uint32_t chipId = Samba::chipId ();
650
634
651
- printf (" CPU reset.\n " );
652
- writeWord (0x400E1A00 , 0xA500000D );
635
+ switch (chipId)
636
+ {
637
+ // SAMD21G18 or SAMD21J18
638
+ case 0x10010000 :
639
+ case 0x10010005 :
640
+ // http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0484c/index.html
641
+ writeWord (0xE000ED0C , 0x05FA0004 );
642
+ break ;
643
+
644
+ // SAM3X8E
645
+ case 0x285e0a60 :
646
+ writeWord (0x400E1A00 , 0xA500000D );
647
+ break ;
648
+
649
+ default :
650
+ printf (" Reset not supported for this CPU.\n " );
651
+ return ;
652
+ }
653
653
654
654
// Some linux users experienced a lock up if the serial
655
655
// port is closed while the port itself is being destroyed.
You can’t perform that action at this time.
0 commit comments