当前位置: 首页>>代码示例>>C++>>正文


C++ MAP_IntMasterEnable函数代码示例

本文整理汇总了C++中MAP_IntMasterEnable函数的典型用法代码示例。如果您正苦于以下问题:C++ MAP_IntMasterEnable函数的具体用法?C++ MAP_IntMasterEnable怎么用?C++ MAP_IntMasterEnable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了MAP_IntMasterEnable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sleepSeconds

void sleepSeconds(uint32_t seconds)
{
	unsigned long i;

	i = milliseconds;
	i += seconds * 1000;

	stay_asleep = true;

	HWREG(NVIC_SYS_CTRL) |= NVIC_SYS_CTRL_SLEEPDEEP;

	while ( stay_asleep && (milliseconds < i) ) {
		MAP_IntMasterDisable();  // Set PRIMASK so CPU wakes on IRQ but ISRs don't execute until PRIMASK is cleared
		SysTickMode_DeepSleepCoarse();

		CPUwfi_safe();

		// Handle low-power SysTick triggers without using the default SysTickIntHandler
		if (HWREG(NVIC_INT_CTRL) & NVIC_INT_CTRL_PENDSTSET) {
			milliseconds += 1000;
			HWREG(NVIC_INT_CTRL) |= NVIC_INT_CTRL_PENDSTCLR;
		} else {
			milliseconds += (DEEPSLEEP_CPU - HWREG(NVIC_ST_CURRENT)) / (DEEPSLEEP_CPU / 1000);
		}

		// Restore SysTick to normal parameters in preparation for full-speed ISR execution
		SysTickMode_Run();
		MAP_IntMasterEnable();  // Clearing PRIMASK allows pending ISRs to run
	}

	HWREG(NVIC_SYS_CTRL) &= ~(NVIC_SYS_CTRL_SLEEPDEEP);
	stay_asleep = false;
}
开发者ID:Aginorty,项目名称:Energia,代码行数:33,代码来源:wiring.c

示例2: main

int main() {
  MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]);
  MAP_IntEnable(FAULT_SYSTICK);
  MAP_IntMasterEnable();
  PRCMCC3200MCUInit();

  cc3200_leds_init();

  /* Console UART init. */
  MAP_PRCMPeripheralClkEnable(CONSOLE_UART_PERIPH, PRCM_RUN_MODE_CLK);
  MAP_PinTypeUART(PIN_55, PIN_MODE_3); /* PIN_55 -> UART0_TX */
  MAP_PinTypeUART(PIN_57, PIN_MODE_3); /* PIN_57 -> UART0_RX */
  MAP_UARTConfigSetExpClk(
      CONSOLE_UART, MAP_PRCMPeripheralClockGet(CONSOLE_UART_PERIPH),
      CONSOLE_BAUD_RATE,
      (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
  MAP_UARTFIFODisable(CONSOLE_UART);

  setvbuf(stdout, NULL, _IONBF, 0);
  setvbuf(stderr, NULL, _IONBF, 0);

  VStartSimpleLinkSpawnTask(8);
  osi_TaskCreate(v7_task, (const signed char *) "v7", V7_STACK_SIZE + 256, NULL,
                 3, NULL);
  osi_TaskCreate(blinkenlights_task, (const signed char *) "blink", 256, NULL,
                 9, NULL);
  osi_start();

  return 0;
}
开发者ID:GDI123,项目名称:smart.js,代码行数:30,代码来源:main.c

示例3: UpdateIndexAtomic

//*****************************************************************************
//
// Change the value of a variable atomically.
//
// \param pulVal points to the index whose value is to be modified.
// \param ulDelta is the number of bytes to increment the index by.
// \param ulSize is the size of the buffer the index refers to.
//
// This function is used to increment a read or write buffer index that may be
// written in various different contexts. It ensures that the read/modify/write
// sequence is not interrupted and, hence, guards against corruption of the
// variable. The new value is adjusted for buffer wrap.
//
// \return None.
//
//*****************************************************************************
static void
UpdateIndexAtomic(volatile unsigned long *pulVal, unsigned long ulDelta,
                  unsigned long ulSize)
{
    tBoolean bIntsOff;

    //
    // Turn interrupts off temporarily.
    //
    bIntsOff = MAP_IntMasterDisable();

    //
    // Update the variable value.
    //
    *pulVal += ulDelta;

    //
    // Correct for wrap. We use a loop here since we don't want to use a
    // modulus operation with interrupts off but we don't want to fail in
    // case ulDelta is greater than ulSize (which is extremely unlikely but...)
    //
    while(*pulVal >= ulSize)
    {
        *pulVal -= ulSize;
    }

    //
    // Restore the interrupt state
    //
    if(!bIntsOff)
    {
        MAP_IntMasterEnable();
    }
}
开发者ID:serikovigor,项目名称:surd,代码行数:50,代码来源:ringbuf.c

示例4: bootmgr_board_init

//*****************************************************************************
//! Board Initialization & Configuration
//*****************************************************************************
static void bootmgr_board_init(void) {
    // set the vector table base
    MAP_IntVTableBaseSet((unsigned long)&g_pfnVectors[0]);

    // enable processor interrupts
    MAP_IntMasterEnable();
    MAP_IntEnable(FAULT_SYSTICK);

    // mandatory MCU initialization
    PRCMCC3200MCUInit();

    mperror_bootloader_check_reset_cause();

#if MICROPY_HW_ANTENNA_DIVERSITY
    // configure the antenna selection pins
    antenna_init0();
#endif

    // enable the data hashing engine
    CRYPTOHASH_Init();

    // init the system led and the system switch
    mperror_init0();

    // clear the safe boot flag, since we can't trust its content after reset
    PRCMClearSafeBootRequest();
}
开发者ID:Ga-vin,项目名称:micropython,代码行数:30,代码来源:main.c

示例5: timerInit

void timerInit()
{
#ifdef TARGET_IS_BLIZZARD_RB1
    //
    //  Run at system clock at 80MHz
    //
    MAP_SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
                       SYSCTL_OSC_MAIN);
#else
    //
    //  Run at system clock at 120MHz
    //
    MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ|SYSCTL_OSC_MAIN|SYSCTL_USE_PLL|SYSCTL_CFG_VCO_480), F_CPU);
#endif

    //
    //  SysTick is used for delay() and delayMicroseconds()
    //

    MAP_SysTickPeriodSet(F_CPU / SYSTICKHZ);
    MAP_SysTickEnable();
    MAP_IntPrioritySet(FAULT_SYSTICK, SYSTICK_INT_PRIORITY);
    MAP_SysTickIntEnable();
    MAP_IntMasterEnable();

    // PIOSC is used during Deep Sleep mode for wakeup
    MAP_SysCtlPIOSCCalibrate(SYSCTL_PIOSC_CAL_FACT);  // Factory-supplied calibration used
}
开发者ID:Aginorty,项目名称:Energia,代码行数:28,代码来源:wiring.c

示例6: BoardInit

//*****************************************************************************
//
//! Board Initialization & Configuration
//!
//! \param  None
//!
//! \return None
//
//*****************************************************************************
static void
BoardInit(void)
{
    //
    // Set vector table base
    //
#ifndef USE_TIRTOS
  //
  // Set vector table base
  //
#if defined(ccs) || defined(gcc)
    MAP_IntVTableBaseSet((unsigned long)&g_pfnVectors[0]);
#endif
#if defined(ewarm)
    MAP_IntVTableBaseSet((unsigned long)&__vector_table);
#endif
#endif

    //
    // Enable Processor
    //
    MAP_IntMasterEnable();
    MAP_IntEnable(FAULT_SYSTICK);

    PRCMCC3200MCUInit();
}
开发者ID:oter,项目名称:BSPTools,代码行数:35,代码来源:main.c

示例7: bootmgr_board_init

//*****************************************************************************
//! Board Initialization & Configuration
//*****************************************************************************
static void bootmgr_board_init(void) {
    // set the vector table base
    MAP_IntVTableBaseSet((unsigned long)&g_pfnVectors[0]);

    // enable processor interrupts
    MAP_IntMasterEnable();
    MAP_IntEnable(FAULT_SYSTICK);

    // mandatory MCU initialization
    PRCMCC3200MCUInit();

    // clear all the special bits, since we can't trust their content after reset
    // except for the WDT reset one!!
    PRCMClearSpecialBit(PRCM_SAFE_BOOT_BIT);
    PRCMClearSpecialBit(PRCM_FIRST_BOOT_BIT);

    // check the reset after clearing the special bits
    mperror_bootloader_check_reset_cause();

#if MICROPY_HW_ANTENNA_DIVERSITY
    // configure the antenna selection pins
    antenna_init0();
#endif

    // enable the data hashing engine
    CRYPTOHASH_Init();

    // init the system led and the system switch
    mperror_init0();
}
开发者ID:19emtuck,项目名称:micropython,代码行数:33,代码来源:main.c

示例8: BoardInit

//*****************************************************************************
//
//! Board Initialization & Configuration
//!
//! \param  None
//!
//! \return None
//
//*****************************************************************************
static void
BoardInit(void)
{
/* In case of TI-RTOS vector table is initialize by OS itself */
#ifndef USE_TIRTOS
    //
    // Set vector table base
    //
#if defined(ccs)
    MAP_IntVTableBaseSet((unsigned long)&g_pfnVectors[0]);
#endif  //ccs
#if defined(ewarm)
    MAP_IntVTableBaseSet((unsigned long)&__vector_table);
#endif  //ewarm
    
#endif  //USE_TIRTOS
    
    //
    // Enable Processor
    //
    MAP_IntMasterEnable();
    MAP_IntEnable(FAULT_SYSTICK);

    PRCMCC3200MCUInit();
}
开发者ID:JamesHyunKim,项目名称:quickstart-samples,代码行数:34,代码来源:main.c

示例9: platform_init

int platform_init()
{
    // Set the clocking to run from PLL
#if defined( FORLM3S9B92 ) || defined( FORLM3S9D92 )
    MAP_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
#else
    MAP_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
#endif

    // Setup PIO
    pios_init();

    // Setup SSIs
    spis_init();

    // Setup UARTs
    uarts_init();

    // Setup timers
    timers_init();

    // Setup PWMs
    pwms_init();

#ifdef BUILD_ADC
    // Setup ADCs
    adcs_init();
#endif

#ifdef BUILD_CAN
    // Setup CANs
    cans_init();
#endif

    // Setup system timer
    cmn_systimer_set_base_freq( MAP_SysCtlClockGet() );
    cmn_systimer_set_interrupt_freq( SYSTICKHZ );

    // Setup ethernet (TCP/IP)
    eth_init();

    // Common platform initialization code
    cmn_platform_init();

    // Virtual timers
    // If the ethernet controller is used the timer is already initialized, so skip this sequence
#if VTMR_NUM_TIMERS > 0 && !defined( BUILD_UIP )
    // Configure SysTick for a periodic interrupt.
    MAP_SysTickPeriodSet( MAP_SysCtlClockGet() / SYSTICKHZ );
    MAP_SysTickEnable();
    MAP_SysTickIntEnable();
    MAP_IntMasterEnable();
#endif

    // All done
    return PLATFORM_OK;
}
开发者ID:zhanjun,项目名称:elua,代码行数:57,代码来源:platform.c

示例10: sys_arch_unprotect

/**
 * This function is used to unlock access to critical sections when lwipopt.h
 * defines SYS_LIGHTWEIGHT_PROT. It enables interrupts if the value of the lev
 * parameter indicates that they were enabled when the matching call to
 * sys_arch_protect() was made.
 *
 * @param lev is the interrupt level when the matching protect function was
 * called
 */
void
sys_arch_unprotect(sys_prot_t lev)
{
  /* Only turn interrupts back on if they were originally on when the matching
     sys_arch_protect() call was made. */
  if(!(lev & 1)) {
    MAP_IntMasterEnable();
  }
}
开发者ID:hakkinen86,项目名称:Luminary-Micro-Library,代码行数:18,代码来源:sys_arch.c

示例11: BoardInit

static void BoardInit(void)
{

  MAP_IntVTableBaseSet((unsigned long)&g_pfnVectors[0]);

  MAP_IntMasterEnable();
  MAP_IntEnable(FAULT_SYSTICK);

  PRCMCC3200MCUInit();
}
开发者ID:Eterneco,项目名称:iot_control,代码行数:10,代码来源:main.c

示例12: BoardInit

//*****************************************************************************
//
//! Board Initialization & Configuration
//!
//! \param  None
//!
//! \return None
//
//*****************************************************************************
static void BoardInit(void)
{
    // Set vector table base
    MAP_IntVTableBaseSet((unsigned long)&g_pfnVectors[0]);

    // Enable Processor
    MAP_IntMasterEnable();
    MAP_IntEnable(FAULT_SYSTICK);

    PRCMCC3200MCUInit();
}
开发者ID:tzhenghao,项目名称:TimerInterruptsOnCC3200,代码行数:20,代码来源:main.c

示例13: initBoard

void initBoard() {
#ifndef USE_TIRTOS
#if defined(ccs) || defined(gcc)
    MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]);
#endif
#if defined(ewarm)
    MAP_IntVTableBaseSet((unsigned long)&__vector_table);
#endif
#endif

    MAP_IntMasterEnable();
    MAP_IntEnable(FAULT_SYSTICK);

    PRCMCC3200MCUInit();

    PinMuxConfig();
    GPIO_IF_LedConfigure(LED1);
    GPIO_IF_LedOff(MCU_RED_LED_GPIO);

    InitTerm();
    ClearTerm();

    UART_PRINT("Blink - Parse for IoT sample application\r\n");
    UART_PRINT("----------------------------------------\r\n");
    UART_PRINT("\r\n");
    UART_PRINT("[Blink] Board init\r\n");

    // start the spawn task
    short status = VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY);
    if (status < 0) {
        UART_PRINT("[Blink] Spawn task failed\r\n");
        ERR_PRINT(status);
        LOOP_FOREVER();
    }

    // initialize the I2C bus
    status = I2C_IF_Open(I2C_MASTER_MODE_FST);
    if (status < 0) {
        UART_PRINT("[Blink] I2C opening error\r\n");
        ERR_PRINT(status);
        LOOP_FOREVER();
    }

    UART_PRINT("[Blink] Device                    : TI SimpleLink CC3200\r\n");
#ifdef USE_TIRTOS
    UART_PRINT("[Blink] Operating system          : TI-RTOS\r\n");
#endif
#ifdef USE_FREERTOS
    UART_PRINT("[Blink] Operating system          : FreeRTOS\r\n");
#endif
#ifndef SL_PLATFORM_MULTI_THREADED
    UART_PRINT("[Blink] Operating system          : None\r\n");
#endif
}
开发者ID:AnjaneyuluAdepu,项目名称:parse-embedded-sdks,代码行数:54,代码来源:board.c

示例14: main

int main() {
#ifndef USE_TIRTOS
  MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]);
#endif
  MAP_IntEnable(FAULT_SYSTICK);
  MAP_IntMasterEnable();
  PRCMCC3200MCUInit();

  /* Console UART init. */
  MAP_PRCMPeripheralClkEnable(CONSOLE_UART_PERIPH, PRCM_RUN_MODE_CLK);
  MAP_PinTypeUART(PIN_55, PIN_MODE_3); /* PIN_55 -> UART0_TX */
  MAP_PinTypeUART(PIN_57, PIN_MODE_3); /* PIN_57 -> UART0_RX */
  MAP_UARTConfigSetExpClk(
      CONSOLE_UART, MAP_PRCMPeripheralClockGet(CONSOLE_UART_PERIPH),
      CONSOLE_BAUD_RATE,
      (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
  MAP_UARTFIFOLevelSet(CONSOLE_UART, UART_FIFO_TX1_8, UART_FIFO_RX4_8);
  MAP_UARTFIFOEnable(CONSOLE_UART);

  setvbuf(stdout, NULL, _IOLBF, 0);
  setvbuf(stderr, NULL, _IOLBF, 0);
  cs_log_set_level(LL_INFO);
  cs_log_set_file(stdout);

  LOG(LL_INFO, ("Hello, world!"));

  MAP_PinTypeI2C(PIN_01, PIN_MODE_1); /* SDA */
  MAP_PinTypeI2C(PIN_02, PIN_MODE_1); /* SCL */
  I2C_IF_Open(I2C_MASTER_MODE_FST);

  /* Set up the red LED. Note that amber and green cannot be used as they share
   * pins with I2C. */
  MAP_PRCMPeripheralClkEnable(PRCM_GPIOA1, PRCM_RUN_MODE_CLK);
  MAP_PinTypeGPIO(PIN_64, PIN_MODE_0, false);
  MAP_GPIODirModeSet(GPIOA1_BASE, 0x2, GPIO_DIR_MODE_OUT);
  GPIO_IF_LedConfigure(LED1);
  GPIO_IF_LedOn(MCU_RED_LED_GPIO);

  if (VStartSimpleLinkSpawnTask(8) != 0) {
    LOG(LL_ERROR, ("Failed to create SL task"));
  }

  if (!mg_start_task(MG_TASK_PRIORITY, MG_TASK_STACK_SIZE, mg_init)) {
    LOG(LL_ERROR, ("Failed to create MG task"));
  }

  osi_start();

  return 0;
}
开发者ID:cobookman,项目名称:mongoose,代码行数:50,代码来源:main.c

示例15: SysPlatformConfig

void SysPlatformConfig(void)
/********************************************************************************/
{
#if defined(COMPLIER_CCS)
    MAP_IntVTableBaseSet((unsigned long)&g_pfnVectors[0]);
#elif defined(COMPLIER_EARM)
    MAP_IntVTableBaseSet((unsigned long)&__vector_table);
#endif
    
    /* Enable Processor */
    MAP_IntMasterEnable();
    MAP_IntEnable(FAULT_SYSTICK);

    PRCMCC3200MCUInit();
}
开发者ID:yuanzhen-liu,项目名称:Bootloader,代码行数:15,代码来源:PlatformStartup.c


注:本文中的MAP_IntMasterEnable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。