Skip to content
Snippets Groups Projects
Select Git revision
  • b53e8edbe50ef1d0d93c580b3f90fe497fc3d18c
  • master default protected
  • Stormwind
  • patch-1
  • schneider/bsec
  • dx/meh-bdf-to-stm
  • dx/somewhat-more-dynamic-config
  • rahix/proper-sleep
  • dx/flatten-config-module
  • genofire/ble-follow-py
  • schneider/ble-stability
  • schneider/ble-stability-new-phy
  • add_menu_vibration
  • plaetzchen/ios-workaround
  • blinkisync-as-preload
  • schneider/max30001-pycardium
  • schneider/max30001-epicaridum
  • schneider/max30001
  • schneider/stream-locks
  • schneider/fundamental-test
  • schneider/ble-buffers
  • v1.12
  • v1.11
  • v1.10
  • v1.9
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
37 results

Makefile

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    stack_fit.c 2.63 KiB
    /*************************************************************************************************/
    /*!
     *  \file
     *
     *  \brief  Stack initialization for fit.
     *
     *  Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved.
     *  ARM Ltd. confidential and proprietary.
     *
     *  IMPORTANT.  Your use of this file is governed by a Software License Agreement
     *  ("Agreement") that must be accepted in order to download or otherwise receive a
     *  copy of this file.  You may not use or copy this file for any purpose other than
     *  as described in the Agreement.  If you do not agree to all of the terms of the
     *  Agreement do not use this file and delete all copies in your possession or control;
     *  if you do not have a copy of the Agreement, you must contact ARM Ltd. prior
     *  to any use, copying or further distribution of this software.
     */
    /*************************************************************************************************/
    
    #include "wsf_types.h"
    #include "wsf_os.h"
    #include "util/bstream.h"
    #include "fit/fit_api.h"
    #include "hci_handler.h"
    #include "dm_handler.h"
    #include "l2c_handler.h"
    #include "att_handler.h"
    #include "smp_handler.h"
    #include "l2c_api.h"
    #include "att_api.h"
    #include "smp_api.h"
    #include "app_api.h"
    #include "svc_dis.h"
    #include "svc_core.h"
    #include "sec_api.h"
    
    /*************************************************************************************************/
    /*!
     *  \brief      Initialize stack.
     *
     *  \return     None.
     */
    /*************************************************************************************************/
    void StackInitFit(void)
    {
      wsfHandlerId_t handlerId;
      uint8_t features[sizeof(uint64_t)];
      uint8_t mask[sizeof(uint64_t)];
    
      SecInit();
      SecAesInit();
      SecCmacInit();
      SecEccInit();
    
      // Only use legacy API.
      Uint64ToBstream(features, 0);
      Uint64ToBstream(mask, HCI_LE_SUP_FEAT_LE_EXT_ADV);
      HciVsSetFeatures(features, mask);
    
      handlerId = WsfOsSetNextHandler(HciHandler);
      HciHandlerInit(handlerId);
    
      handlerId = WsfOsSetNextHandler(DmHandler);
      DmDevVsInit(0);
      DmAdvInit();
      DmConnInit();
      DmConnSlaveInit();
      DmSecInit();
      DmSecLescInit();
      DmPrivInit();
      DmHandlerInit(handlerId);
    
      handlerId = WsfOsSetNextHandler(L2cSlaveHandler);
      L2cSlaveHandlerInit(handlerId);
      L2cInit();
      L2cSlaveInit();
    
      handlerId = WsfOsSetNextHandler(AttHandler);
      AttHandlerInit(handlerId);
      AttsInit();
      AttsIndInit();
    
      handlerId = WsfOsSetNextHandler(SmpHandler);
      SmpHandlerInit(handlerId);
      SmprInit();
      SmprScInit();
      HciSetMaxRxAclLen(100);
    
      handlerId = WsfOsSetNextHandler(AppHandler);
      AppHandlerInit(handlerId);
    
      handlerId = WsfOsSetNextHandler(FitHandler);
      FitHandlerInit(handlerId);
    }