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

C++ HalLedSet函数代码示例

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

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



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

示例1: zb_HandleOsalEvent

/**
 * @brief   Esta función es llamada por el SO cuando se debe atender un
 *          evento de la tarea.
 * @param   event   Mascara de bits conteniendo los eventos a atender
 */
void zb_HandleOsalEvent(uint16 event)
{
    uint8 logicalType;
    
    if (event & SYS_EVENT_MSG)
    {      
    }
    if (event & ZB_ENTRY_EVENT)
    {  
        // inicializa UART
        initUart(uartRxCB);
        // blick LED 1 para indicar que se está uniendo a la red
        HalLedBlink(HAL_LED_1, 0, 50, 500 );
        HalLedSet(HAL_LED_2, HAL_LED_MODE_OFF);   
        // lee tipo de logical device desde la memoria NV
        zb_ReadConfiguration(ZCD_NV_LOGICAL_TYPE, sizeof(uint8), &logicalType);
        // inicia la red
        zb_StartRequest();
    }
    if (event & MY_START_EVT)
    {
        // inicia la red
        zb_StartRequest();
    }
    if (event & SEND_UART_MSG)
    {
        // envia mensaje por UART a la PC
        //HalLcdWriteString("UART_EVT", HAL_LCD_LINE_1);
        sendUartMessage(&msgReport, &alarmFlags);
    }
    if (event & MY_TEST_EVT)
    {
        // crea mensaje de prueba
        msgReport.msgType = MSG_TYPE_REPORT;
        msgReport.sequence++;
        msgReport.lenData = MSG_LEN_DATA_REPORT;
        for (uint8 i = 0; i < 8; i++)
            msgReport.mac[i] = i;
        // datos de prueba
        static double d[10] = {220.5, 0.354, 85.12, 88.33, 85.06, 0.98, 1.23, 3.25, 0.97, 4.55};
        for (int i = 0; i < 10; i++)
            memcpy(&(msgReport.data[i*4]), &(d[i]), sizeof(double));
        // flags de prueba
        uint16 flags = 0;
        // imprime info en LCD
        HalLcdWriteString("TEST_EVT", HAL_LCD_LINE_1);
        HalLcdWriteStringValue("#", msgReport.sequence, 10, HAL_LCD_LINE_2);
        // envia mensaje por UART
        sendUartMessage(&msgReport, &flags);
        // crea evento nuevamente
        osal_start_timerEx(sapi_TaskID, MY_TEST_EVT, 5000);
    }
}
开发者ID:arguelles-manuel,项目名称:smartmeter,代码行数:58,代码来源:collector.c


示例2: zclSampleTemperatureSensor_ProcessIdentifyTimeChange

/*********************************************************************
 * @fn      zclSampleTemperatureSensor_ProcessIdentifyTimeChange
 *
 * @brief   Called to process any change to the IdentifyTime attribute.
 *
 * @param   none
 *
 * @return  none
 */
static void zclSampleTemperatureSensor_ProcessIdentifyTimeChange( void )
{
  if ( zclSampleTemperatureSensor_IdentifyTime > 0 )
  {
    osal_start_timerEx( zclSampleTemperatureSensor_TaskID, SAMPLETEMPERATURESENSOR_IDENTIFY_TIMEOUT_EVT, 1000 );
    HalLedBlink ( HAL_LED_4, 0xFF, HAL_LED_DEFAULT_DUTY_CYCLE, HAL_LED_DEFAULT_FLASH_TIME );
  }
  else
  {
    if ( zclSampleTemperatureSensor_OnOff )
    {
      HalLedSet ( HAL_LED_4, HAL_LED_MODE_ON );
    }
    else
    {
      HalLedSet ( HAL_LED_4, HAL_LED_MODE_OFF );
    }

    osal_stop_timerEx( zclSampleTemperatureSensor_TaskID, SAMPLETEMPERATURESENSOR_IDENTIFY_TIMEOUT_EVT );
  }
}
开发者ID:niuniu500w,项目名称:led_gprs,代码行数:30,代码来源:zcl_sampletemperaturesensor.c


示例3: zclSampleTemperatureSensor_LcdDisplayUpdate

/*********************************************************************
 * @fn      zclSampleTemperatureSensor_LcdDisplayUpdate
 *
 * @brief   Called to update the LCD display.
 *
 * @param   none
 *
 * @return  none
 */
void zclSampleTemperatureSensor_LcdDisplayUpdate( void )
{
  // turn on red LED for temperatures >= 24.00C
  if ( zclSampleTemperatureSensor_MeasuredValue >= 2400 )
  {
    HalLedSet ( HAL_LED_1, HAL_LED_MODE_OFF );
    HalLedSet ( HAL_LED_2, HAL_LED_MODE_ON );
  }
  // turn on green LED for temperatures <= 20.00C
  else if ( zclSampleTemperatureSensor_MeasuredValue <= 2000 )
  {
    HalLedSet ( HAL_LED_1, HAL_LED_MODE_ON );
    HalLedSet ( HAL_LED_2, HAL_LED_MODE_OFF );
  }
  // turn on both red and green LEDs for temperatures between 20.00C and 24.00C
  else
  {
    HalLedSet ( HAL_LED_1, HAL_LED_MODE_ON );
    HalLedSet ( HAL_LED_2, HAL_LED_MODE_ON );
  }

  if ( giTemperatureSensorScreenMode == TEMPSENSE_HELPMODE )
  {
    zclSampleTemperatureSensor_LcdDisplayHelpMode();
  }
  else
  {
    zclSampleTemperatureSensor_LcdDisplayMainMode();
  }
}
开发者ID:niuniu500w,项目名称:led_gprs,代码行数:39,代码来源:zcl_sampletemperaturesensor.c


示例4: zclSampleSw_ProcessZDOMsgs

/*********************************************************************
 * @fn      zclSampleSw_ProcessZDOMsgs()
 *
 * @brief   Process response messages
 *
 * @param   none
 *
 * @return  none
 */
void zclSampleSw_ProcessZDOMsgs( zdoIncomingMsg_t *inMsg )
{
  switch ( inMsg->clusterID )
  {
    case End_Device_Bind_rsp:
      if ( ZDO_ParseBindRsp( inMsg ) == ZSuccess )
      {
        // Light LED
        HalLedSet( HAL_LED_4, HAL_LED_MODE_ON );
      }
#if defined(BLINK_LEDS)
      else
      {
        // Flash LED to show failure
        HalLedSet ( HAL_LED_4, HAL_LED_MODE_FLASH );
      }
#endif
      break;

    case Match_Desc_rsp:
      {
        ZDO_ActiveEndpointRsp_t *pRsp = ZDO_ParseEPListRsp( inMsg );
        if ( pRsp )
        {
          if ( pRsp->status == ZSuccess && pRsp->cnt )
          {
            zclSampleSw_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;
            zclSampleSw_DstAddr.addr.shortAddr = pRsp->nwkAddr;
            // Take the first endpoint, Can be changed to search through endpoints
            zclSampleSw_DstAddr.endPoint = pRsp->epList[0];

            // Light LED
            HalLedSet( HAL_LED_4, HAL_LED_MODE_ON );
          }
          osal_mem_free( pRsp );
        }
      }
      break;
  }
}
开发者ID:flofeurstein,项目名称:MTProj,代码行数:49,代码来源:zcl_samplesw.c


示例5: SimpleBLECentral_Init

/*********************************************************************
 * @fn      SimpleBLECentral_Init
 *
 * @brief   Initialization function for the Simple BLE Central App Task.
 *          This is called during initialization and should contain
 *          any application specific initialization (ie. hardware
 *          initialization/setup, table initialization, power up
 *          notification).
 *
 * @param   task_id - the ID assigned by OSAL.  This ID should be
 *                    used to send messages and set timers.
 *
 * @return  none
 */
void SimpleBLECentral_Init( uint8 task_id )
{
  simpleBLETaskId = task_id;

  // 串口初始化
  NPI_InitTransport(uart_NpiSerialCallback); 
  //NPI_WriteTransport("SimpleBLECentral_Init\r\n", 23);

  // Setup Central Profile
  {
    uint8 scanRes = DEFAULT_MAX_SCAN_RES;
    GAPCentralRole_SetParameter ( GAPCENTRALROLE_MAX_SCAN_RES, sizeof( uint8 ), &scanRes );
  }
  
  // Setup GAP
  GAP_SetParamValue( TGAP_GEN_DISC_SCAN, DEFAULT_SCAN_DURATION );
  GAP_SetParamValue( TGAP_LIM_DISC_SCAN, DEFAULT_SCAN_DURATION );
  GGS_SetParameter( GGS_DEVICE_NAME_ATT, GAP_DEVICE_NAME_LEN, (uint8 *) simpleBLEDeviceName );

  // Setup the GAP Bond Manager
  {
    uint32 passkey = DEFAULT_PASSCODE;
    uint8 pairMode = DEFAULT_PAIRING_MODE;
    uint8 mitm = DEFAULT_MITM_MODE;
    uint8 ioCap = DEFAULT_IO_CAPABILITIES;
    uint8 bonding = DEFAULT_BONDING_MODE;
    GAPBondMgr_SetParameter( GAPBOND_DEFAULT_PASSCODE, sizeof( uint32 ), &passkey );
    GAPBondMgr_SetParameter( GAPBOND_PAIRING_MODE, sizeof( uint8 ), &pairMode );
    GAPBondMgr_SetParameter( GAPBOND_MITM_PROTECTION, sizeof( uint8 ), &mitm );
    GAPBondMgr_SetParameter( GAPBOND_IO_CAPABILITIES, sizeof( uint8 ), &ioCap );
    GAPBondMgr_SetParameter( GAPBOND_BONDING_ENABLED, sizeof( uint8 ), &bonding );
  }  

  // Initialize GATT Client
  VOID GATT_InitClient();

  // Register to receive incoming ATT Indications/Notifications
  GATT_RegisterForInd( simpleBLETaskId );

  // Initialize GATT attributes
  GGS_AddService( GATT_ALL_SERVICES );         // GAP
  GATTServApp_AddService( GATT_ALL_SERVICES ); // GATT attributes

  // Register for all key events - This app will handle all key events
  RegisterForKeys( simpleBLETaskId );
  
  // makes sure LEDs are off
  HalLedSet( (HAL_LED_1 | HAL_LED_2), HAL_LED_MODE_OFF );
  
  // Setup a delayed profile startup
  osal_set_event( simpleBLETaskId, START_DEVICE_EVT );
}
开发者ID:tanxjian,项目名称:BLE-CC254x-1.3.2,代码行数:66,代码来源:simpleBLECentral.c


示例6: SampleApp_MessageMSGCB

/*********************************************************************
 * @fn      SampleApp_MessageMSGCB
 *
 * @brief   Data message processor callback.  This function processes
 *          any incoming data - probably from other devices.  So, based
 *          on cluster ID, perform the intended action.
 *
 * @param   none
 *
 * @return  none
 */
void SampleApp_MessageMSGCB( afIncomingMSGPacket_t *pkt ) //接收數據
{
 // uint16 flashTime;
  
  switch ( pkt->clusterId )
  {
    
    case SAMPLEAPP_P2P_CLUSTERID:
      osal_memcpy(periodicData, pkt->cmd.Data, 27);
      LedState=LedState+1;
      if(LedState == 1)
         HalLedSet(HAL_LED_3, HAL_LED_MODE_ON);
      else if(LedState == 2)
         {HalLedSet(HAL_LED_3, HAL_LED_MODE_OFF);
          LedState=0;}
      break;

    case SAMPLEAPP_PERIODIC_CLUSTERID:
      // osal_memset(periodicData, 0 , 15);
      osal_memcpy(periodicData, pkt->cmd.Data, 27);
      
       LedState=LedState+1;
      // HalUARTWrite(0, "Rx:", 3);        //提示信息
      // HalUARTWrite(0, pkt->cmd.Data, pkt->cmd.DataLength); //輸出接收到的數據
      // HalUARTWrite(0, "\n", 1);         //迴車換行
   
        if(LedState == 1)
         HalLedSet(HAL_LED_3, HAL_LED_MODE_ON);
        else if(LedState == 2)
         {HalLedSet(HAL_LED_3, HAL_LED_MODE_OFF);
          LedState=0;}
      break;

    case SAMPLEAPP_FLASH_CLUSTERID:     //此實驗沒有使用,到後面實驗詳解
    //   flashTime = BUILD_UINT16(pkt->cmd.Data[1], pkt->cmd.Data[2] );
       HalLedBlink( HAL_LED_3, 2, 25 ,100 );
       break;
  }
}
开发者ID:howar82003,项目名称:LLL,代码行数:50,代码来源:SampleApp.c


示例7: rangeext_ProcessIdentifyTimeChange

/*********************************************************************
 * @fn      rangeext_ProcessIdentifyTimeChange
 *
 * @brief   Called to blink led for specified IdentifyTime attribute value
 *
 * @param   none
 *
 * @return  none
 */
static void rangeext_ProcessIdentifyTimeChange( void )
{
  if ( rangeExtIdentifyTime > 0 )
  {
    osal_start_timerEx( rangeExtTaskID, RANGEEXT_IDENTIFY_TIMEOUT_EVT, 1000 );
    HalLedBlink ( HAL_LED_4, 0xFF, HAL_LED_DEFAULT_DUTY_CYCLE, HAL_LED_DEFAULT_FLASH_TIME );
  }
  else
  {
    HalLedSet ( HAL_LED_4, HAL_LED_MODE_OFF );
    osal_stop_timerEx( rangeExtTaskID, RANGEEXT_IDENTIFY_TIMEOUT_EVT );
  }
}
开发者ID:MobileHealthMonitoringSystem,项目名称:MHMS,代码行数:22,代码来源:rangeext.c


示例8: zclSampleLight_ProcessIdentifyTimeChange

/*********************************************************************
 * @fn      zclSampleLight_ProcessIdentifyTimeChange
 *
 * @brief   Called to process any change to the IdentifyTime attribute.
 *
 * @param   none
 *
 * @return  none
 */
static void zclSampleLight_ProcessIdentifyTimeChange( void )
{
  
  if ( zclSampleLight_IdentifyTime > 0 )
  {
    osal_start_timerEx( zclSampleLight_TaskID, SAMPLELIGHT_IDENTIFY_TIMEOUT_EVT, 1000 );
    HalLedBlink ( HAL_LED_1, 0xFF, HAL_LED_DEFAULT_DUTY_CYCLE, HAL_LED_DEFAULT_FLASH_TIME );
  }
  else
  {
    if ( zclSampleLight_OnOff )
    {
      HalLedSet ( HAL_LED_2, HAL_LED_MODE_ON );
    }
    else
      {
        HalLedSet ( HAL_LED_2, HAL_LED_MODE_OFF );
        osal_stop_timerEx( zclSampleLight_TaskID, SAMPLELIGHT_IDENTIFY_TIMEOUT_EVT );
      }
      
  }
}
开发者ID:KimiRaikking,项目名称:z-stack,代码行数:31,代码来源:zcl_samplelight.c


示例9: loadcontrol_ProcessIdentifyTimeChange

/*********************************************************************
 * @fn      loadcontrol_ProcessIdentifyTimeChange
 *
 * @brief   Called to blink led for specified IdentifyTime attribute value
 *
 * @param   none
 *
 * @return  none
 */
static void loadcontrol_ProcessIdentifyTimeChange( void )
{
  if ( loadControlIdentifyTime > 0 )
  {
    osal_start_timerEx( loadControlTaskID, LOADCONTROL_IDENTIFY_TIMEOUT_EVT, 1000 );
    HalLedBlink ( HAL_LED_4, 0xFF, HAL_LED_DEFAULT_DUTY_CYCLE, HAL_LED_DEFAULT_FLASH_TIME );
  }
  else
  {
    HalLedSet ( HAL_LED_4, HAL_LED_MODE_OFF );
    osal_stop_timerEx( loadControlTaskID, LOADCONTROL_IDENTIFY_TIMEOUT_EVT );
  }
}
开发者ID:junstrix,项目名称:zstack-end-device,代码行数:22,代码来源:loadcontrol.c


示例10: keyfobapp_StopAlert

/*********************************************************************
 * @fn      keyfobapp_StopAlert
 *
 * @brief   Stops an alert
 *
 * @param   none
 *
 * @return  none
 */
void keyfobapp_StopAlert( void )
{

  keyfobAlertState = ALERT_STATE_OFF;

  buzzerStop();
  buzzer_state = BUZZER_OFF;
  HalLedSet( (HAL_LED_1 | HAL_LED_2), HAL_LED_MODE_OFF );


  #if defined ( POWER_SAVING )
    osal_pwrmgr_device( PWRMGR_BATTERY );
  #endif
}
开发者ID:bluewish,项目名称:ble_dev,代码行数:23,代码来源:keyfobdemo.c


示例11: MT_UtilLedControl

/***************************************************************************************************
 * @fn      MT_UtilLedControl
 *
 * @brief   Process the LED Control Message
 *
 * @param   pBuf - pointer to the received data
 *
 * @return  None
 ***************************************************************************************************/
void MT_UtilLedControl(uint8 *pBuf)
{
  uint8 iLed, Led, iMode, Mode, cmdId;
  uint8 retValue = ZFailure;

  /* parse header */
  cmdId = pBuf[MT_RPC_POS_CMD1];
  pBuf += MT_RPC_FRAME_HDR_SZ;

  /* LED and Mode */
  iLed = *pBuf++;
  iMode = *pBuf;

  if ( iLed == 1 )
    Led = HAL_LED_1;
  else if ( iLed == 2 )
    Led = HAL_LED_2;
  else if ( iLed == 3 )
    Led = HAL_LED_3;
  else if ( iLed == 4 )
    Led = HAL_LED_4;
  else if ( iLed == 0xFF )
    Led = HAL_LED_ALL;
  else
    Led = 0;

  if ( iMode == 0 )
    Mode = HAL_LED_MODE_OFF;
  else if ( iMode == 1 )
    Mode = HAL_LED_MODE_ON;
  else if ( iMode == 2 )
    Mode = HAL_LED_MODE_BLINK;
  else if ( iMode == 3 )
    Mode = HAL_LED_MODE_FLASH;
  else if ( iMode == 4 )
    Mode = HAL_LED_MODE_TOGGLE;
  else
    Led = 0;

  if ( Led != 0 )
  {
    HalLedSet (Led, Mode);
    retValue = ZSuccess;
  }

  /* Build and send back the response */
  MT_BuildAndSendZToolResponse(((uint8)MT_RPC_CMD_SRSP | (uint8)MT_RPC_SYS_UTIL), cmdId, 1, &retValue );

}
开发者ID:12019,项目名称:hellowsn,代码行数:58,代码来源:MT_UTIL.c


示例12: zclSampleLight_OnOffCB

/*********************************************************************
 * @fn      zclSampleLight_OnOffCB
 *
 * @brief   Callback from the ZCL General Cluster Library when
 *          it received an On/Off Command for this application.
 *
 * @param   cmd - COMMAND_ON, COMMAND_OFF or COMMAND_TOGGLE
 *
 * @return  none
 */
static void zclSampleLight_OnOffCB( uint8 cmd )
{ 
  if ( cmd == COMMAND_ON )// Turn on the light
    zclSampleLight_OnOff = LIGHT_ON;

  else if ( cmd == COMMAND_OFF )// Turn off the light
    zclSampleLight_OnOff = LIGHT_OFF;

  else // Toggle the light
  {
    if ( zclSampleLight_OnOff == LIGHT_OFF )
          zclSampleLight_OnOff = LIGHT_ON;
    else
          zclSampleLight_OnOff = LIGHT_OFF;
  }

  // In this sample app, we use LED4 to simulate the Light  
  if ( zclSampleLight_OnOff == LIGHT_ON )
  {
    HalLedSet( HAL_LED_2, HAL_LED_MODE_ON ); // setting the LED_1 on
  }
  else
    HalLedSet( HAL_LED_2, HAL_LED_MODE_OFF ); // setting the LED_1 off
}
开发者ID:KimiRaikking,项目名称:z-stack,代码行数:34,代码来源:zcl_samplelight.c


示例13: HalLedInit

/***************************************************************************************************
 * @fn      HalLedInit
 *
 * @brief   Initialize LED Service
 *
 * @param   init - pointer to void that contains the initialized value
 *
 * @return  None
 ***************************************************************************************************/
void HalLedInit (void)
{
#if (HAL_LED == TRUE)
  HAL_TURN_OFF_LED1();
  LED1_DDR |= LED1_BV;
  HAL_TURN_OFF_LED2();
  LED2_DDR |= LED2_BV;
  /* Initialize all LEDs to OFF */
  HalLedSet (HAL_LED_ALL, HAL_LED_MODE_OFF);
#endif /* HAL_LED */
#ifdef BLINK_LEDS
  /* Initialize sleepActive to FALSE */
  HalLedStatusControl.sleepActive = FALSE;
#endif
}
开发者ID:Aline1029,项目名称:NPLink-Mote-STM32-SDK,代码行数:24,代码来源:hal_led.c


示例14: zllSampleBridge_ProcessIdentifyTimeChange

/*********************************************************************
 * @fn      zllSampleBridge_ProcessIdentifyTimeChange
 *
 * @brief   Called to process any change to the IdentifyTime attribute.
 *
 * @param   none
 *
 * @return  none
 */
static void zllSampleBridge_ProcessIdentifyTimeChange( void )
{
  if ( zllSampleBridge_IdentifyTime > 0 )
  {
    osal_start_timerEx( zllSampleBridge_TaskID, SAMPLEBRIDGE_IDENTIFY_TIMEOUT_EVT, 1000 );
#if ( HAL_LED == TRUE )
    HalLedBlink ( HAL_LED_4, 0xFF, HAL_LED_DEFAULT_DUTY_CYCLE, HAL_LED_DEFAULT_FLASH_TIME );
#endif
  }
  else
  {
#if ( HAL_LED == TRUE )
    HalLedSet ( HAL_LED_4, HAL_LED_MODE_OFF );
#endif
    osal_stop_timerEx( zllSampleBridge_TaskID, SAMPLEBRIDGE_IDENTIFY_TIMEOUT_EVT );
  }
}
开发者ID:saiwaiyanyu,项目名称:Zlight,代码行数:26,代码来源:zll_samplebridge.c


示例15: InitBoard

/*********************************************************************
 * @fn      InitBoard()
 * @brief   Initialize the CC2540DB Board Peripherals
 * @param   level: COLD,WARM,READY
 * @return  None
 */
void InitBoard( uint8 level )
{
  if ( level == OB_COLD )
  {
    // Interrupts off
    osal_int_disable( INTS_ALL );
    // Turn all LEDs off
    HalLedSet( HAL_LED_ALL, HAL_LED_MODE_OFF );
    // Check for Brown-Out reset
    // ChkReset();
  }
  else  // !OB_COLD
  {
    /* Initialize Key stuff */
    OnboardKeyIntEnable = HAL_KEY_INTERRUPT_ENABLE;
    HalKeyConfig( OnboardKeyIntEnable, OnBoard_KeyCallback);
  }
}
开发者ID:yang325,项目名称:CC2541_Peripheral,代码行数:24,代码来源:OnBoard.c


示例16: HalLedInit

/***************************************************************************************************
 * @fn      HalLedInit
 *
 * @brief   Initialize LED Service
 *
 * @param   init - pointer to void that contains the initialized value
 *
 * @return  None
 ***************************************************************************************************/
void HalLedInit (void)
{
#if (HAL_LED == TRUE)
  HalLedSet(HAL_LED_ALL, HAL_LED_MODE_OFF);  // Initialize all LEDs to OFF.

  // Set LED GPIOs to outputs.
  LED1_DDR |= LED1_BV;
  LED2_DDR |= LED2_BV;
//#if (!defined HAL_PA_LNA && !defined HAL_PA_LNA_CC2590)
//  LED2_DDR |= LED2_BV;
//#if (!defined CC2540_MINIDK && !defined HAL_BOARD_CC2540USB)
//  LED3_DDR |= LED3_BV;
//#endif
//#endif
#if defined BLINK_LEDS
  HalLedStatusControl.sleepActive = FALSE;  // Initialize sleepActive to FALSE.
#endif
#endif
}
开发者ID:nevinxu,项目名称:HM502B1,代码行数:28,代码来源:hal_led.c


示例17: zb_StartConfirm

/**
 * @brief   Este callback es llamado por el stack de ZigBee luego de que la 
 *          operación de Start Request es completada.
 * @param   status  El estado de la operación. ZB_SUCCESS indica que la
 *                  operación fue completada exitosamente. Sino, el estado es
 *                  un código de error.
 */
void zb_StartConfirm(uint8 status)
{ 
    // si el dispositivo se inicio correctamente, cambia el estado
    if (status == ZB_SUCCESS)
    {
        // enciende LED 1 para indicar que el coordinador inició la red
        HalLedSet(HAL_LED_1, HAL_LED_MODE_ON);
        // actualiza display LCD
        HalLcdWriteString("COORD. INICIADO", HAL_LCD_LINE_1);
        HalLcdWriteString("", HAL_LCD_LINE_2);
        // cambia estado de la app a iniciada
        appState = APP_START;
    }
    else
    {
        // reintenta iniciarse con un tiempo de espera
        osal_start_timerEx(sapi_TaskID, MY_START_EVT, myStartRetryDelay);
    }
}
开发者ID:arguelles-manuel,项目名称:smartmeter,代码行数:26,代码来源:collector.c


示例18: uApp_ProcessEvent

/*********************************************************************
 * @fn      GenericApp_ProcessEvent
 *
 * @brief   Generic Application Task event processor.  This function
 *          is called to process all events for the task.  Events
 *          include timers, messages and any other user defined events.
 *
 * @param   task_id  - The OSAL assigned task ID.
 * @param   events - events to process.  This is a bit map and can
 *                   contain more than one event.
 *
 * @return  none
 */
uint16 uApp_ProcessEvent( uint8 task_id, uint16 events )
{
  if ( events & SYS_EVENT_MSG )
  {
    // return unprocessed events
    return (events ^ SYS_EVENT_MSG);
  }
  
  if ( events & UAPP_EVENT_1)
  {
	  HalLedSet(HAL_LED_4, HAL_LED_MODE_TOGGLE);
	  osal_start_timerEx(uApp_TaskID, UAPP_EVENT_1, 500);
	  //osal_set_event(uApp_TaskID, UAPP_EVENT_1);
	  return events ^ UAPP_EVENT_1;
  }

  // Discard unknown events
  return 0;
}
开发者ID:DRuffer,项目名称:coinForth,代码行数:32,代码来源:uApp.c


示例19: HalSensorTest

/*********************************************************************
 * @fn      HalSensorTest
 *
 * @brief   Run a self-test on all the sensors
 *
 * @param   none
 *
 * @return  bitmask of error flags
 */
uint16 HalSensorTest(void)
{
  uint16 i;
  uint8 selfTestResult;

  halSensorEnableMap = 0;
  selfTestResult = 0;
  HalGyroTurnOn();

  for  (i=0; i<N_TEST_RUNS; i++)
  {
    HalLedSet(HAL_LED_2,HAL_LED_MODE_TOGGLE);

    // 1. Temp sensor test
    if (HalIRTempTest())
      selfTestResult |= ST_IRTEMP;

    // 2. Humidity  sensor test
    if (HalHumiTest())
      selfTestResult |= ST_HUMID;

    // 3. Magnetometer test
    if (HalMagTest())
      selfTestResult |= ST_MAGN;

    // 4. Accelerometer test
    if (HalAccTest())
      selfTestResult |= ST_ACC;

    // 5. Barometer test
    if (HalBarTest())
      selfTestResult |= ST_PRESS;

    // 6. Gyro test
    if (HalGyroTest())
      selfTestResult |= ST_GYRO;
  }

  HalGyroTurnOff();

  return selfTestResult;
}
开发者ID:zilzu,项目名称:BLE-CC254x-1.4.2.2,代码行数:51,代码来源:hal_sensor.c


示例20: TransmitApp_MessageMSGCB

/*********************************************************************
 * @fn      TransmitApp_MessageMSGCB
 *
 * @brief   Data message processor callback.  This function processes
 *          any incoming data - probably from other devices.  So, based
 *          on cluster ID, perform the intended action.
 *
 * @param   none
 *
 * @return  none
 */
void TransmitApp_MessageMSGCB( afIncomingMSGPacket_t *pkt )
{
  int16 i;
  uint8 error = FALSE;

  switch ( pkt->clusterId )
  {
    case TRANSMITAPP_CLUSTERID_TESTMSG:
      if (pkt->cmd.DataLength != TransmitApp_MaxDataLength)
      {
        error = TRUE;
      }

      for (i=4; i<pkt->cmd.DataLength; i++)
      {
        if (pkt->cmd.Data[i] != i%256)
          error = TRUE;
      }

      if (error)
      {
        // Display error LED
        HalLedSet(HAL_LED_1, HAL_LED_MODE_ON);
      }
      else
      {
        if ( !timerOn )
        {
          osal_start_timerEx( TransmitApp_TaskID, TRANSMITAPP_RCVTIMER_EVT,
                                                  TRANSMITAPP_DISPLAY_TIMER );
          clkShdw = osal_GetSystemClock();
          timerOn = TRUE;
        }
        rxAccum += pkt->cmd.DataLength;
      }
      break;

    // Could receive control messages in the future.
    default:
      break;
  }
}
开发者ID:liuyd07,项目名称:ZigbeeComm,代码行数:53,代码来源:TransmitApp.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ Halt函数代码示例发布时间:2022-05-30
下一篇:
C++ HalLcdWriteString函数代码示例发布时间: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