Skip to content
Snippets Groups Projects
Select Git revision
  • af0261155b8ac936a0c38df5e34bbdbd5f9294cd
  • master default
  • test
  • rahix/hw-lock-new-mutex
  • dx/somewhat-more-dynamic-config
  • schneider/sdk-0.2.1-7
  • schneider/bsec
  • dx/meh-bdf-to-stm
  • 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

ble.c

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    ble.c 6.95 KiB
    #include "epicardium.h"
    #include "modules/log.h"
    
    #include "fs_util.h"
    #include "wsf_types.h"
    #include "wsf_buf.h"
    #include "wsf_trace.h"
    #include "ble_api.h"
    #include "hci_vs.h"
    #include "att_api.h"
    #include "trng.h"
    
    #include "FreeRTOS.h"
    #include "timers.h"
    
    #include <stdio.h>
    #include <string.h>
    #include <stdbool.h>
    
    #define WSF_BUF_POOLS 6
    #define WSF_BUF_SIZE 0x1048
    
    uint32_t SystemHeapSize = WSF_BUF_SIZE;
    uint32_t SystemHeap[WSF_BUF_SIZE / 4];
    uint32_t SystemHeapStart;
    
    /* Task ID for the ble handler */
    static TaskHandle_t ble_task_id = NULL;
    
    /*! Default pool descriptor. */
    /* clang-format off */
    static wsfBufPoolDesc_t mainPoolDesc[WSF_BUF_POOLS] =
    {
      {  16,  8 },
      {  32,  4 },
      {  64,  4 },
      { 128,  4 },
      { 256,  4 },
      { 512,  4 }
    };
    /* clang-format on */
    
    static StaticTimer_t x;
    static TimerHandle_t timerWakeup = NULL;
    static int lasttick              = 0;
    
    /*! \brief  Stack initialization for app. */
    extern void StackInit(void);
    extern void AppInit(void);
    extern void bleuart_init(void);
    extern void bleFileTransfer_init(void);
    extern void bleCard10_init(void);
    extern void BbBleDrvSetTxPower(int8_t power);
    
    /*************************************************************************************************/
    void PalSysAssertTrap(void)
    {
    	while (1) {
    	}
    }
    /*************************************************************************************************/
    static bool_t myTrace(const uint8_t *pBuf, uint32_t len)
    {
    	extern uint8_t wsfCsNesting;
    
    	if (wsfCsNesting == 0) {
    		fwrite(pBuf, len, 1, stdout);
    		return TRUE;
    	}