Skip to content

Commit

Permalink
use different syntax to set vpp for P08 and P01 so that both work. Ne…
Browse files Browse the repository at this point in the history
…ither syntax worked for both platforms
  • Loading branch information
antus committed Jul 24, 2023
1 parent ce64e27 commit 291eed6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Kernels/Kernel.S
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,13 @@ IntelFlashUnlock:
| Unlock
move.w #0x7060, (SIM_CSOR0).w | $FFFFFA4E
| Enable +12v Vpp
bset #VPP_BIT, (HARDWARE_IO).w | Set Vpp
#if defined P08
bset #VPP_BIT, (HARDWARE_IO).w | Does not work on P01, needed for P08
#else
move.w (HARDWARE_IO).w, %d1 | Move Vpp Latch Address value to d1
bset #VPP_BIT, %d1 | Set Vpp Latch Bit
move.w %d1, (HARDWARE_IO).w | Move modified value back to Latch Address
#endif
bsr.w LongWaitWithWatchdog
rts

Expand Down Expand Up @@ -701,9 +707,14 @@ IntelFlashLock:
| Lock
move.w #0x1060, (SIM_CSOR0).w | $FFFFFA4E
| Disable +12v Vpp
bclr #VPP_BIT, (HARDWARE_IO).w | Clear Vpp
#if defined P08
bclr #VPP_BIT, (HARDWARE_IO).w | Does not work on P01, needed for P08
#else
move.w (HARDWARE_IO).w, %d1 | Move Vpp Latch Address value to d1
bclr #VPP_BIT, %d1 | Set Vpp Latch Bit
move.w %d1, (HARDWARE_IO).w | Move modified value back to Latch Address
#endif
bsr.w LongWaitWithWatchdog

rts

| =============== S U B R O U T I N E =======================================
Expand Down

0 comments on commit 291eed6

Please sign in to comment.