Arnaud VALLEY / Mbed 2 deprecated Pinscape_Controller_V2_arnoz

Dependencies:   mbed FastIO FastPWM USBDevice

Committer:
mjr
Date:
Thu May 12 05:57:53 2016 +0000
Revision:
59:94eb9265b6d7
Child:
60:f38da020aa13
Replaced library malloc with custom version that's slightly more efficient and makes more memory available overall

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mjr 59:94eb9265b6d7 1 ; Put this in READWRITE memory, to ensure that it goes in RAM
mjr 59:94eb9265b6d7 2 ; rather than flash.
mjr 59:94eb9265b6d7 3 AREA iapexec_asm_code, CODE, READWRITE
mjr 59:94eb9265b6d7 4
mjr 59:94eb9265b6d7 5 ; iapExecAsm(FSTAT)
mjr 59:94eb9265b6d7 6 ; FSTAT = address of ftfa->FSTAT register
mjr 59:94eb9265b6d7 7 ;
mjr 59:94eb9265b6d7 8 ; Note: arguments passed in R0, R1...
mjr 59:94eb9265b6d7 9 EXPORT iapExecAsm
mjr 59:94eb9265b6d7 10 iapExecAsm
mjr 59:94eb9265b6d7 11
mjr 59:94eb9265b6d7 12 ; push R1, R2, link
mjr 59:94eb9265b6d7 13 STMFD R13!, {R1,R2,LR}
mjr 59:94eb9265b6d7 14
mjr 59:94eb9265b6d7 15 ; clear old errors from status bits
mjr 59:94eb9265b6d7 16 MOVS R1, #0x70 ; FPVIOL (0x10) | ACCERR (0x20) | RDCOLOERR (0x40)
mjr 59:94eb9265b6d7 17 STRB R1, [R0]
mjr 59:94eb9265b6d7 18
mjr 59:94eb9265b6d7 19 ; start command
mjr 59:94eb9265b6d7 20 MOVS R1, #0x80 ; CCIF (0x80)
mjr 59:94eb9265b6d7 21 STRB R1, [R0]
mjr 59:94eb9265b6d7 22
mjr 59:94eb9265b6d7 23 ; wait until command completed - the CCIF bit is SET when the command completes
mjr 59:94eb9265b6d7 24 MOVS R2, #0x80 ; CCIF (0x80)
mjr 59:94eb9265b6d7 25 L1
mjr 59:94eb9265b6d7 26 LDRB R1, [R0]
mjr 59:94eb9265b6d7 27 TSTS R1, R2 ; CCIF (0x80)
mjr 59:94eb9265b6d7 28 BEQ L1
mjr 59:94eb9265b6d7 29
mjr 59:94eb9265b6d7 30 ; pop registers and return
mjr 59:94eb9265b6d7 31 LDMFD R13!, {R1,R2,PC}
mjr 59:94eb9265b6d7 32
mjr 59:94eb9265b6d7 33 END
mjr 59:94eb9265b6d7 34