Porting from LPC214x to LPC1768

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Porting from LPC214x to LPC1768

164 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ennegi on Tue Jul 02 12:02:42 MST 2013
Hi all! I need your help for my porting of a source file.

I take a source code of LPC214x and I found this:


void

EnterCriticalSection(  )

{

        VIC_Temp = VICIntEnable;    /* Save VICIntEnable */

 VICIntEnClr = VIC_Temp;     /* Disable Interruptions */

}

 

void

ExitCriticalSection(  )

{

    VICIntEnable = VIC_Temp;    /* Restore VICIntEnable */

}



How I "traslate" this for my LPC1768? Thanks a lot!
0 Kudos
1 Reply

152 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Jul 02 12:41:26 MST 2013
Interrupt handling on Cortex-M3 is very different to the old ARM7 based parts.

I strongly suggested that you start off by taking a look at ARM's Cortex-M3 docs, as linked to from:

http://support.code-red-tech.com/CodeRedWiki/ArmCpuInfo

and also read Joseph Yiu's book if you can get hold of a copy.

Note that if you are using CMSIS for your LPC17 development, then the functions [FONT=Courier New]__disable_irq()[/FONT] and [FONT=Courier New]__enable_irq() [/FONT]that this defines probably do what you want.

http://support.code-red-tech.com/CodeRedWiki/Support4CMSIS

Regards,
CodeRedSupport
0 Kudos