• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ HAL_ENABLE_INTERRUPTS函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: main

/**************************************************************************************************
 * @fn          main
 *
 * @brief       Start of application.
 *
 * @param       none
 *
 * @return      none
 **************************************************************************************************
 */
int main(void)
{
  /* Initialize hardware */
  HAL_BOARD_INIT();

  /* Initialze the HAL driver */
  HalDriverInit();

  /* Initialize NV system */
  osal_snv_init();
  
  /* Initialize LL */

  /* Initialize the operating system */
  osal_init_system();

  /* Enable interrupts */
  HAL_ENABLE_INTERRUPTS();

  /* Setup Keyboard callback */
  HalKeyConfig(false, MSA_Main_KeyCallback);

  /* Blink LED on startup */
  HalLedSet (HAL_LED_4, HAL_LED_MODE_ON);
    
  /* Start OSAL */
  osal_start_system(); // No Return from here

  return 0;
}
开发者ID:JensenSung,项目名称:shred444,代码行数:40,代码来源:HostTest_Main.c


示例2: main

int main( void )
{
    halInit();
    moduleInit();    
    printf("\r\n****************************************************\r\n");    
    printf("Fragmentation Example - ROUTER - using AFZDO\r\n");
    buttonIsr = &handleButtonPress;    

#define MODULE_START_DELAY_IF_FAIL_MS 5000

    /* See basic communications examples for more information about module startup. */
    struct moduleConfiguration defaultConfiguration = DEFAULT_MODULE_CONFIGURATION_ROUTER;
    start: 
    while ((result = startModule(&defaultConfiguration, GENERIC_APPLICATION_CONFIGURATION)) != MODULE_SUCCESS)
    {
        printf("Module start unsuccessful. Error Code 0x%02X. Retrying...\r\n", result);
        delayMs(MODULE_START_DELAY_IF_FAIL_MS);
    }
    printf("On Network!\r\n");
    setLed(0);
    /* On network, display info about this network */ 
#ifdef DISPLAY_NETWORK_INFORMATION    //excluded to reduce code size
    displayNetworkConfigurationParameters();   
    displayDeviceInformation();
#endif 
    HAL_ENABLE_INTERRUPTS();

    /* Now the network is running - send a message to the coordinator every few seconds.*/
#define TEST_CLUSTER 0x77    

    /* Fill test message buffer with an incrementing counter */
    int i = 0;
    for (i=0; i<MESSAGE_LENGTH; i++)
    {
    	testMessage[i] = i;
    }
    printf("Sending the following message:\r\n");

    uint8_t counter = 0;
    while (1)
    {       
        printf("Sending Message #%u L%u to Short Address 0x0000 (Coordinator) ", counter++, MESSAGE_LENGTH);
        /* Send an extended length message to a short address */
        moduleResult_t result = afSendDataExtendedShort(DEFAULT_ENDPOINT, DEFAULT_ENDPOINT, 0, TEST_CLUSTER, testMessage, MESSAGE_LENGTH);  //a short message - coordinator will receive an AF_INCOMING_MSG_EXT
        if (result == MODULE_SUCCESS)
        {
            printf("Success\r\n");
        } else {
            printf("ERROR %i ", result);
#ifdef RESTART_AFTER_ZM_FAILURE
            printf("\r\nRestarting\r\n");
            goto start;
#else        
            printf("stopping\r\n");
            while(1);
#endif
        }
        delayMs(2000);  
    }   
}
开发者ID:vtoanb,项目名称:msp430lioamaintain,代码行数:60,代码来源:example_fragmentation_router_afzdo.c


示例3: main

/**
 * @brief       Start of application.
 */
int main(void)
{
  /* Initialize hardware */
   HAL_BOARD_INIT();

  // Initialize board I/O
  InitBoard( OB_COLD );

  /* Initialze the HAL driver */
  HalDriverInit();

  /* Initialize NV system */
  osal_snv_init();

  /* Initialize LL */

  /* Initialize the operating system */
  osal_init_system();

  /* Enable interrupts */
  HAL_ENABLE_INTERRUPTS();

  // Final board initialization
  InitBoard( OB_READY );

  osal_pwrmgr_device( PWRMGR_ALWAYS_ON );
  
  HCI_EXT_ClkDivOnHaltCmd(HCI_EXT_DISABLE_CLK_DIVIDE_ON_HALT);

    
  /* Start OSAL */
  osal_start_system(); // No Return from here

  return 0;
}
开发者ID:Pinzgauer16,项目名称:MyoBridge,代码行数:38,代码来源:MyoBridge_Main.c


示例4: Read_Data

/*************************************************************
 * @fn        Write_Data
 *
 * @brief     This func for read data form slave device
 * 
 * @param     uint8 - Address of slave device
 *
 * @return    uint8 - The byte read form the Addr 
 */
uint8 Read_Data(uint8 Addr)
{
  uint8 Value;
  
  HAL_DISABLE_INTERRUPTS();
  I2c_Start(); //make the I2C bus begin
  //if((Addr != Last_Addr + 1) || (Addr & 0xFF))
  //{
  I2c_Write_Byte(0xC8 ); // write address 1100100 and make the R/w with 0
  I2c_Ack();
    
  I2c_Write_Byte(Addr);// write register to slaver
  I2c_Ack();

  I2c_Start(); //repeat make the I2C bus begin

  I2c_Write_Byte(0xC9);// write address 1100100 and make the R/w with 1
  I2c_Ack();
  
  Value = I2c_Read_Byte(); // we recive the content from slaver 
  I2c_Stop();
  
  HAL_ENABLE_INTERRUPTS();
  return Value;
}
开发者ID:TemcoLijun,项目名称:GateServer,代码行数:34,代码来源:i2c.c


示例5: HAL_ISR_FUNCTION

HAL_ISR_FUNCTION(port1Isr, P1INT_VECTOR)
#endif
{
  HAL_ENTER_ISR();
#endif
  PxIFG = 0;
  PxIF = 0;

  spiRdyIsr = 1;

#if !defined HAL_SPI_MASTER
  
  if (spiTxLen == 0)
  {
#if !defined HAL_SBL_BOOT_CODE
    CLEAR_SLEEP_MODE();
    UxDBUF = 0x00;
    SPI_SET_RDY_OUT();
#endif
    SPI_CLR_RDY_OUT(); /* SPI_RDYOut = 1 */
  }
#endif

#if !defined HAL_SBL_BOOT_CODE
  CLEAR_SLEEP_MODE();
  HAL_EXIT_ISR();
#endif

 HAL_ENABLE_INTERRUPTS();
}
开发者ID:yang325,项目名称:CC2541_Peripheral,代码行数:30,代码来源:_hal_uart_spi.c


示例6: sblExec

/**************************************************************************************************
 * @fn          sblExec
 *
 * @brief       Infinite SBL execute loop that returns upon receiving a code enable.
 *
 * input parameters
 *
 * None.
 *
 * output parameters
 *
 * None.
 *
 * @return      None.
 **************************************************************************************************
 */
static void sblExec(void)
{
  uint32 dlyCnt = 0;
  vddWait(VDD_MIN_NV);
  HAL_ENABLE_INTERRUPTS();

  while (1)
  {
    if (dlyCnt++ & 0x4000)
    {
      SB_TOGGLE_LED1();
    }

    HalUARTPollUSB();
    if (sbExec())
    {
      break;
    }
  }

  SB_TURN_ON_LED1();
  SB_TURN_ON_LED2();
  // Delay to allow the SB_ENABLE_CMD response to be flushed.
  for (dlyCnt = 0; dlyCnt < 0x40000; dlyCnt++)
  {
    HalUARTPollUSB();
  }
}
开发者ID:Zmarkteam,项目名称:zmarkt,代码行数:44,代码来源:sb_main.c


示例7: handle_pending_hsrs

void handle_pending_hsrs(void)
{
    extern int32_t sched_lock;
    int nr;
    list_head_t *list, *node;
    hsr_t *hsr;

    if (sched_lock > 0)
        return;

    // just only to prevent hisrs to schedule
    ++sched_lock;

    while (1) {
        nr = HAL_FIND_FIRST_SET(hsr_bitmap);
        if (nr < 0)
            break;

        list = hsr_array + nr;
        node = LIST_FIRST(list);
        BUG_ON(NULL == node);
        hsr = LIST_ENTRY(node, hsr_t, node);
        hsr->function(hsr->data);

        HAL_DISABLE_INTERRUPTS();
        --hsr->count;
        if (hsr->count <= 0)
            LIST_DEL(node);
        if (LIST_EMPTY(list))
            hsr_bitmap &= ~(1 << nr);
        HAL_ENABLE_INTERRUPTS();
    }

    --sched_lock;
}
开发者ID:kevinzhang1986,项目名称:minios,代码行数:35,代码来源:hsr.c


示例8: main

/*---------------------------------------------------------------------------
 * main
 *-------------------------------------------------------------------------*/
int main(void)
{
  /* Initialize hardware */
  HAL_BOARD_INIT();

  // Initialize board I/O
  InitBoard( OB_COLD );

  /* PCB specific initialization */
  cbHW_init(); 

  /* Initialze the HAL driver */
  HalDriverInit();

  /* Initialize NV system */
  osal_snv_init();

  /* Initialize the operating system */
  osal_init_system();

  /* Enable interrupts */
  HAL_ENABLE_INTERRUPTS();

  /* Final board initialization */
  InitBoard( OB_READY );   

#if defined ( POWER_SAVING )
  osal_pwrmgr_device( PWRMGR_BATTERY );
#endif

  /* Start OSAL */
  osal_start_system(); // No Return from here

  return 0;
}
开发者ID:cklam,项目名称:cc25xxbleStack,代码行数:38,代码来源:main.c


示例9: main

/**************************************************************************************************
 * @fn          main
 *
 * @brief       Start of application.
 *
 * @param       none
 *
 * @return      none
 **************************************************************************************************
 */
int main(void)
{
  /* Initialize hardware */
  HAL_BOARD_INIT();

  /* Initialze the HAL driver */
  HalDriverInit();
 
  /* Initialize NV system */
  osal_snv_init();

  /* Initialize the operating system */
  osal_init_system();

  /* Enable interrupts */
  HAL_ENABLE_INTERRUPTS();

#if defined POWER_SAVING
  osal_pwrmgr_device( PWRMGR_BATTERY );
#endif

  /* Start OSAL */
  osal_start_system(); // No Return from here

  return 0;
}
开发者ID:JBTech,项目名称:OS-CC2540,代码行数:36,代码来源:HostTest_Main.c


示例10: cyg_user_start

/****************************************************************************
 Function:    cyg_user_start

 Description: This routine is the entry point of the application task.

 Inputs:      none
 Returns:     none
****************************************************************************/
void cyg_user_start(void)
{
    /* Turn all led's on */
    P4205_LED_ON(P4205_BOARD_CNTL_STATUS, P4205_FP_LED_ALL);

#ifdef CYGPKG_KERNEL                   /* Using eCos kernel */

    /* Create a dacMode Thread */
    cyg_thread_create(10,                                    /* Thread priority */
                      (cyg_thread_entry_t *)TskFunc_dacMode, /* Entry function */
                      0,                                     /* Thread function arg */
                      "dacMode",                             /* Thread name */
                      stThread_dacMode,                      /* Thread Stack Base */
                      CYGNUM_HAL_STACK_SIZE_TYPICAL,         /* Thread Stack Size */
                      &hThread_dacMode,                      /* Thread Handle */
                      &oThread_dacMode);                     /* Thread Housekeeping Info */

    /* Take thread out of suspended state */
    cyg_thread_resume(hThread_dacMode);

#else                                  /* No eCos kernel */

    /* Enable Processor Interrupts - not required but enables gdb/insight
     * for stopping an executing program using the stop button or Ctrl-C.
     */
    HAL_ENABLE_INTERRUPTS();

    /* Invoke application directly */
    TskFunc_dacMode();

#endif
}                                      /* end cyg_user_start() */
开发者ID:Joel397,项目名称:Ongoing_work_files,代码行数:40,代码来源:dacmode.c


示例11: main

int main( void )
{
    halInit();
    moduleInit();
    printf("\r\nWriting NV Items\r\n");
    result = moduleReset();
    if (result == MODULE_SUCCESS)
    {
        displaySysResetInd();  // Display the contents of the received SYS_RESET_IND message
    } else {
        printf("Module Reset ERROR 0x%02X\r\n", result);
    }
    debugConsoleIsr = &handleDebugConsoleInterrupt;   //call method handleDebugConsoleInterrupt() when a byte is received    
    HAL_ENABLE_INTERRUPTS();              //Enable Interrupts

    while (1)
    {
        uint8_t whichNvItem = getWhichNvItemToWrite();  
        if (whichNvItem != NO_CHARACTER_RECEIVED)
        {
            uint8_t nvItemSize = getNvItemSize(whichNvItem);
            printf("\r\nWriting to NV item %u, L%u:", whichNvItem, nvItemSize);    
            printHexBytes(dataToWrite, nvItemSize);
            result = sysNvWrite(whichNvItem, dataToWrite);
            if (result != MODULE_SUCCESS)
            {
                printf("sysNvWrite ERROR 0x%02X\r\n", result);
            }
        }
    }
}
开发者ID:project-trace,项目名称:Anaren,代码行数:31,代码来源:example_write_nonvolatile_memory.c


示例12: main

int main( void )
{
    halInit();
    printf("\r\n****************************************************\r\n");
    printf("Simple Application Example - COORDINATOR - using AFZDO\r\n");
    HAL_ENABLE_INTERRUPTS();
    startZnp(COORDINATOR);

    printf("On Network!\r\n");
    
    /* On network, display info about this network */   
    getNetworkConfigurationParameters();                
    getDeviceInformation();
    
    /* Now the network is running - wait for any received messages from the ZNP */
#ifdef VERBOSE_MESSAGE_DISPLAY    
        printAfIncomingMsgHeaderNames();
#endif
        while (1)
    {
        while (SRDY_IS_HIGH());      //wait until SRDY goes low indicating a message has been received.   
        displayMessages();
    }
    
}
开发者ID:bst1206,项目名称:sd_mobile_app,代码行数:25,代码来源:example_simple_application_coordinator_afzdo.c


示例13: main

/**************************************************************************************************
 * @fn          main
 *
 * @brief       Start of application.
 *
 * @param       none
 *
 * @return      none
 **************************************************************************************************
 */
int main(void)
{
  /* Initialize hardware */
  HAL_BOARD_INIT();

  /* Initialze the HAL driver */
  HalDriverInit();

  /* Initialize MAC */
  MAC_Init();

  /* Initialize the operating system */
  osal_init_system();

  /* Enable interrupts */
  HAL_ENABLE_INTERRUPTS();

  /* Setup OSAL Timer */
  HalTimerConfig ( OSAL_TIMER,                         // 16bit timer3
                   HAL_TIMER_MODE_CTC,                 // Clear Timer on Compare
                   HAL_TIMER_CHANNEL_SINGLE,           // Channel 1 - default
                   HAL_TIMER_CH_MODE_OUTPUT_COMPARE,   // Output Compare mode
                   FALSE,                              // Use interrupt
                   MSA_Main_TimerCallBack);            // Channel Mode

  /* Setup Keyboard callback */
  HalKeyConfig(MSA_KEY_INT_ENABLED, MSA_Main_KeyCallback);

  /* Initialize UART */
  UartCnfg.baudRate = HAL_UART_BR_9600;
  UartCnfg.callBackFunc = HalUARTCBack;
  UartCnfg.flowControl = FALSE;
  UartCnfg.flowControlThreshold = 0;  /* max Buffer Size in Byte*/
  UartCnfg.idleTimeout = 200;

  /*
   * halUARTOpen provvederà tramite la funzione halUartAllocBuffers ad allocare e inizializzare
   * le strutture dati RxUART e TxUART.
   */

  UartCnfg.rx = RxUART;
  UartCnfg.tx = TxUART;
  UartCnfg.rx.maxBufSize = UART_MAX_BUFFER_SIZE;
  UartCnfg.tx.maxBufSize = UART_MAX_BUFFER_SIZE;
  UartCnfg.intEnable = TRUE ;  /* enable or disable the interrupts */
  UartCnfg.configured = TRUE;

  uint8 status = HalUARTOpen(HAL_UART_PORT, &UartCnfg); /* passo l'indirizzo di memoria della struttura dati
  	  	  	  	  	  	  	  	  	  	  UartCnfg, Passaggio per riferimento!!!*/




  /* Start OSAL */
  osal_start_system(); // No Return from here

  return 0;
}
开发者ID:filippomortari,项目名称:Biometric_badge,代码行数:68,代码来源:msa_Main.c


示例14: main

/**************************************************************************************************
 * @fn          main
 *
 * @brief       Start of application.
 *
 * @param       none
 *
 * @return      none
 **************************************************************************************************
 */
int main(void)
{
  /* Initialize hardware */
  HAL_BOARD_INIT();

  // Initialize board I/O
  InitBoard( OB_COLD );

  /* Initialze the HAL driver */
  HalDriverInit();

  /* Initialize NV system */
  osal_snv_init();
  
  /* Initialize LL */

  /* Initialize the operating system */
  osal_init_system();

  /* Enable interrupts */
  HAL_ENABLE_INTERRUPTS();

  // Final board initialization
  InitBoard( OB_READY );

  #if defined ( POWER_SAVING )
    osal_pwrmgr_device( PWRMGR_BATTERY );
  #endif

#if 0
  P0DIR |= 0x32;
  P0_1 = 0;
  P0_4 = 0;
  P0_5 = 0;
#endif    

#if 0
  P1DIR |= 0x08;
  P1_3 = 0;
  
  P2DIR |= 0x01;
  P2_0 = 1;
#endif
  

//  E009_Init();
//  E009_ActivatePwrKey();
  
  //HalLedSet(HAL_LED1_G,HAL_LED_MODE_ON);
  /* Start OSAL */
  osal_start_system(); // No Return from here

  return 0;
}
开发者ID:tanxjian,项目名称:BLE-CC254x-1.3.2,代码行数:64,代码来源:simpleBLECentral_Main.c


示例15: sblWait

/**************************************************************************************************
 * @fn          sblWait
 *
 * @brief       A timed-out wait loop that exits early upon receiving a force code/sbl byte.
 *
 * input parameters
 *
 * None.
 *
 * output parameters
 *
 * None.
 *
 * @return      TRUE to run the code image, FALSE to run the SBL.
 **************************************************************************************************
 */
static uint8 sblWait(void)
{
  uint32 dlyCnt = 0x260000;
  uint8 rtrn = FALSE;
  HAL_ENABLE_INTERRUPTS();

  while (1)
  {
    uint8 ch;

    HalUARTPollUSB();
    if (HalUARTRx(&ch, 1))
    {
      if (ch == SB_FORCE_BOOT)
      {
        break;
      }
      else if (ch == SB_FORCE_RUN)
      {
        dlyCnt = 0;
      }
    }

    if (SB1_PRESS)
    {
      break;
    }

    if (SB2_PRESS || (dlyCnt-- == 0))
    {
      rtrn = TRUE;
      break;
    }

    // RR-xing LED display while waiting.
    if (dlyCnt & 0x2000)
    {
      SB_TURN_OFF_LED2();
      SB_TURN_ON_LED1();
    }
    else
    {
      SB_TURN_OFF_LED1();
      SB_TURN_ON_LED2();
    }
  }

  HAL_DISABLE_INTERRUPTS();
  SB_TURN_OFF_LED1();
  SB_TURN_OFF_LED2();

  return rtrn;
}
开发者ID:Zmarkteam,项目名称:zmarkt,代码行数:69,代码来源:sb_main.c


示例16: main

int main( void )
{
    halInit();
    moduleInit();    
    printf("\r\n****************************************************\r\n");    
    printf("Secure Communications Example - ROUTER - using AFZDO\r\n");
    HAL_ENABLE_INTERRUPTS();

#define MODULE_START_DELAY_IF_FAIL_MS 5000

    struct moduleConfiguration defaultConfiguration = DEFAULT_MODULE_CONFIGURATION_ROUTER;
    defaultConfiguration.securityMode = SECURITY_MODE_PRECONFIGURED_KEYS;
    defaultConfiguration.securityKey = key;
    start:
    while ((result = startModule(&defaultConfiguration, GENERIC_APPLICATION_CONFIGURATION)) != MODULE_SUCCESS)
    {
        printf("Module start unsuccessful. Error Code 0x%02X. Retrying...\r\n", result);
        delayMs(MODULE_START_DELAY_IF_FAIL_MS);
    }

    printf("On Network!\r\n");
    setLed(0);

    /* On network, display info about this network */
#ifdef DISPLAY_NETWORK_INFORMATION     
    displayNetworkConfigurationParameters();
    displayDeviceInformation();
#endif  

    /* Now the network is running - send a message to the coordinator every few seconds.*/
#define TEST_CLUSTER 0x77    

    while (1)
    {
        printf("Sending Message %u  ", counter++);
        result = afSendData(DEFAULT_ENDPOINT,DEFAULT_ENDPOINT,0, TEST_CLUSTER, testMessage, 5);
        if (result == MODULE_SUCCESS)
        {
            printf("Success\r\n");
        } else {
            printf("ERROR %02X ", result);
#ifdef RESTART_AFTER_ZM_FAILURE
            printf("\r\nRestarting\r\n");
            goto start;
#else        
            printf("stopping\r\n");
            while(1);
#endif
        }
        toggleLed(1);
        delayMs(2000);
    }
}
开发者ID:vtoanb,项目名称:msp430lioamaintain,代码行数:53,代码来源:example_secure_comms_router_afzdo.c


示例17: main

//JFang, 任何8051单片机c程序, 都是由 main 函数开始的,
// 我们拿到一份代码,首先需要找到main函数
int main(void)
{
 /* Initialize hardware */
  HAL_BOARD_INIT();      //JFang,初始化时钟稳定时钟等等

  // Initialize board I/O
  //JFang, 冷启动,关闭了led灯与中断, 一边接下来的各种初始化不受干扰
  InitBoard( OB_COLD ); 

  /* Initialze the HAL driver */
  HalDriverInit();   //JFang, 各种驱动的初始化、如按键、lcd、adc、usb、uart等

  /* Initialize NV system */
  //JFang, snv 内部用于保存配对数据或你的用户自定义数据的一段flash,4kB空间
  osal_snv_init(); 

  /* Initialize LL */

  /* Initialize the operating system */
  //JFang, oasl 操作系统初始化, 包含内存分配、消息队列、定时器、电源管理和任务等
  osal_init_system(); 

  /* Enable interrupts */
  HAL_ENABLE_INTERRUPTS();//JFang, 开启全局中断

  // Final board initialization
  InitBoard( OB_READY );  //JFang,设置标志标示系统初始化完毕 

  #if defined ( POWER_SAVING )
  //JFang, 如果你使能了低功耗, 就启动低功耗模式,
    osal_pwrmgr_device( PWRMGR_BATTERY );
  #endif
/*
低功耗部分
1.如何总是在PM1
  osal_pwrmgr_device( PWRMGR_ALWAYS_ON );
2.如何进入PM2
  osal_pwrmgr_device( PWRMGR_BATTERY );在空闲的时候就会进入到PM2模式
3.如何进入PM3
  存在连接就断开连接,存在广播就停掉广播,并确认自己创建的所有定时任务都已关闭,
  则系统应该就会进入PM3模式,只能进行外部中断唤醒
*/

  /* Start OSAL */
  osal_start_system(); // No Return from here
/* osal 操作系统启动,实际上是一个大循环,只是检查相对应的标志位,
就指定相对应的任务,看到这里,同学们应该往哪里看呢?其实,这已经是尽头了?那么我们的应用程序是在哪里写的呢
其实是在上面的 上面的函数 osal_init_system 里就初始化了,现在回过头去看看
osal_init_system 这个函数内部就知道了
*/    
  return 0;
}
开发者ID:drprajna,项目名称:intellitherm,代码行数:54,代码来源:thermometer_Main.c


示例18: sblExec

/**************************************************************************************************
 * @fn          sblExec
 *
 * @brief       Infinite SBL execute loop that returns upon receiving a code enable.
 *
 * input parameters
 *
 * None.
 *
 * output parameters
 *
 * None.
 *
 * @return      None.
 **************************************************************************************************
 */
static void sblExec(void)
{

  uint32 dlyCnt = 0;
  uint8 sbExec_rc;

  if (znpCfg1 == ZNP_CFG1_UART)
  {
    URX0IE = 1;
    HAL_ENABLE_INTERRUPTS();
	
    sbReportState(SB_STATE_BOOTLOADER_ACTIVE);
  }
  else
  {
    /* For preventing an unknown delay after sending SB_FORCE_BOOT and before being able to send
       SB_HANDSHAKE_CMD, this call was moved to the processing of SB_HANDSHAKE_CMD, which has an
       associated response (SB_FORCE_BOOT does not have any response). This change was required
       for the bootloader to work on the Alektrona gateway reference board. It was verified only
       with UART, so at the moment the behavior for SPI is left unchanged. */
    vddWait(VDD_MIN_NV);
  }

  while (1)
  {
    if (znpCfg1 == ZNP_CFG1_UART)
    {
      sbUartPoll();
    }

    sbExec_rc = sbExec();
    if (sbExec_rc == SB_CMND_ENABLE_STATE_REPORTING)
    {
      sbReportState(SB_STATE_BOOTLOADER_ACTIVE);
    }
    else if (sbExec_rc == SB_CMND_ENABLED_CMD_OK)
    {
      // Delay to allow the SB_ENABLE_CMD response to be flushed.
      if (znpCfg1 == ZNP_CFG1_UART)
      {
        for (dlyCnt = 0; dlyCnt < 0x40000; dlyCnt++)
        {
          sbUartPoll();
        }

        URX0IE = 0;
      }
      break;
    }
  }
}
开发者ID:sdhczw,项目名称:ACGatewayDemo,代码行数:67,代码来源:sb_main.c


示例19: main

int main( void )
{
    halInit();
    moduleInit();
    buttonIsr = &handleButtonPress;
    sysTickIsr = &sysTick;    
    printf("\r\n****************************************************\r\n");
    printf("Config Application Example - COORDINATOR\r\n");    
    clearLeds();    
    halRgbLedPwmInit();
    initSysTick();
    HAL_ENABLE_INTERRUPTS(); //NEW
    stateMachine();    //run the state machine
}
开发者ID:ninisnanas,项目名称:Hello-TA,代码行数:14,代码来源:example_config_application_coordinator_afzdo.c


示例20: cyg_start

cyg_start( void )
#endif
{
    int loops;
    CYG_TEST_INIT();
    CYG_TEST_INFO( "cyg_user_start()" );
    HAL_ENABLE_INTERRUPTS();
    loops = start();
    // Typically about 1200 loops execute on the 33MHz 86832;
    // I hoped to put in a check that we hadn't wasted time in
    // spurious interrupts, but kernel instrumentation, for example,
    // is more than enough to slow the world down... so keep this
    // very weak test in, as a placeholder.
    CYG_TEST_CHECK( 100 <= loops, "Not enough tests executed" );
    CYG_TEST_EXIT( "All done" );
}
开发者ID:EPiCS,项目名称:reconos_v2,代码行数:16,代码来源:slebintr.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ HAL_ENTER_CRITICAL_SECTION函数代码示例发布时间:2022-05-30
下一篇:
C++ HAL_Delay函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap