Skip to content

Commit

Permalink
Merge pull request #45 from hexagon5un/develop
Browse files Browse the repository at this point in the history
Fixes #44: XH-M188 lockup after power cycle
  • Loading branch information
hexagon5un authored Aug 3, 2017
2 parents b37bf94 + 96d2244 commit 6689c36
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions XH-M188/boardcore.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ BOARDINIT:
; Init Timer for PWM
; Unlock EEPROM and set AFR0 flag
CALL ULOCK
MOV FLASH_CR2, #0b10000000
MOV FLASH_NCR2,#0b01111111
MOV OPT2, #0b00000001
MOV OPT2, #0b00000001 ; set AFR0 bit, alternate PWM function
MOV NOPT2,#0b11111110
; should wait for EOP bit here...meh, seems to work
; then re-lock
MOV FLASH_CR2, #0b00000000
MOV FLASH_NCR2,#0b11111111
1$: BTJF FLASH_IAPSR,#2,1$ ; wait for "end of programming" bit
CALL LOCK

; Set voltage-control PWM timers
Expand Down

1 comment on commit 6689c36

@TG9541
Copy link
Owner

@TG9541 TG9541 commented on 6689c36 Aug 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Should the spin lock 1$: BTJF FLASH_IAPSR,#2,1$ be part of LOCK?

Please sign in to comment.