⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 portfunc.c

📁 430系列开发之MSP430FE42x开发代码实例
💻 C
字号:
//**************************************************************************
//    Port Functions for the FE427
//
//    Stefan Schauer
//    Texas Instruments Freising
//    Date        Comments
//    =====================
//    08/22/03    Code Starts for FE427

//**************************************************************************
#include "device.h"
#include "display.h"
#include "emeter.h"


// ************************************************************
// Definitions & Declarations
// ************************************************************


// ************************************************************
// functions forward declarations
// ************************************************************


// ************************************************************
// functions
// ************************************************************

//====================================================================
/**
  * Interrupt service routine for Port 2.
  *
  */
#ifdef __IAR_SYSTEMS_ICC__
#if __VER__ < 200
interrupt[PORT2_VECTOR] void port2_isr(void)
#else
#pragma vector=PORT2_VECTOR
__interrupt void port2_isr( void )
#endif
#endif

#ifdef __CROSSWORKS__
void port1_isr(void)   __interrupt[PORT2_VECTOR] 
#endif
{
  // Test if S2 was pressed
  if (P2IFG & 0x08)  
  {
      P2IFG &= ~0x08;  //clear int. flag
      P2IE  &= ~0x08;  //disable interrupt
      // Restart measurement (set Embedded Signal Processing into "Measurement" mode)
      SD16CTL |= SD16REFON; // Switch Reference oon
      ESPCTL &= ~ESPSUSP;   // Set ESP into Active Mode

      // Startmeasurement (set Embedded Signal Processing into "Measurement" mode)
      //  ensure that it is not in measurement or calibration mode,
      if ((RET0 & 0x8000) == 0) 
      { 
        // Set Embedded Signal Processing into "Idle" mode
        MBOUT1= modeMEASURE; // modeMEASURE;
        MBOUT0= mSET_MODE;
      }

      OP_Mode = measure;
      LPM3_EXIT;
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -