This is Webservice SDK for mbed. LPCXpresso1769/LPC1768/FRDM-K64F/LPC4088

Dependents:   MbedFileServer_1768MiniDK2 RedWireBridge IssueDebug_gcc MiMicRemoteMCU-for-Mbed ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers NyLPC_cIsr.cpp Source File

NyLPC_cIsr.cpp

00001 /*********************************************************************************
00002  * PROJECT: MiMic
00003  * --------------------------------------------------------------------------------
00004  *
00005  * This file is part of MiMic
00006  * Copyright (C)2011 Ryo Iizuka
00007  *
00008  * MiMic is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License as published
00010  * by the Free Software Foundation, either version 3 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public License
00019  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020  *
00021  * For further information please contact.
00022  *  http://nyatla.jp/
00023  *  <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
00024  *
00025  *********************************************************************************/
00026 #include "../NyLPC_cIsr.h"
00027 #if NyLPC_ARCH==NyLPC_ARCH_MBEDRTOS
00028 #include "mbed.h"
00029 #include "rtos.h"
00030 
00031 void NyLPC_cIsr_enterCritical(void)
00032 {
00033     __disable_irq();
00034 }
00035 
00036 /**
00037  * 全ての割込みとタスクスイッチを再開します。
00038  */
00039 void NyLPC_cIsr_exitCritical(void)
00040 {
00041     __enable_irq();
00042 }
00043 
00044 static NyLPC_cIsr_EventHandler _eth_irs=NULL;
00045 void NyLPC_cIsr_setEnetISR(NyLPC_cIsr_EventHandler i_handler)
00046 {
00047     _eth_irs=i_handler;
00048 }
00049 
00050 //LPC176xとLPC4088の場合
00051 #if NyLPC_MCU==NyLPC_MCU_LPC4088 || NyLPC_MCU==NyLPC_MCU_LPC17xx
00052 /**
00053  * 割込み解除を通知するセマフォ。lEMACInitで設定する。
00054  */
00055 extern "C" void ENET_IRQHandler(void)
00056 {
00057     unsigned long ulStatus;
00058     ulStatus = LPC_EMAC->IntStatus;
00059     /* Clear the interrupt. */
00060     LPC_EMAC->IntClear = ulStatus;
00061     if(_eth_irs!=NULL){
00062         _eth_irs(ulStatus);
00063     }
00064 }
00065 #elif NyLPC_MCU==NyLPC_MCU_K64F
00066 //F64Fのイーサネットハンドラはドライバに書いてあります。
00067 #else
00068 #error "BAD MCU"
00069 #endif
00070 #endif