Skip to content
Snippets Groups Projects
Select Git revision
  • 2766e2f19f49f25b63164b9c7342e705fdc27a6f
  • master default protected
  • backslash
  • nickname-match-configs
  • genofire/leds_rgb_get_state
  • genofire/rockets-state
  • genofire/ble-follow-py
  • plaetzchen/ios-workaround
  • blinkisync-as-preload
  • genofire/haule-ble-fs-deactive
  • schneider/max30001-pycardium
  • schneider/max30001-epicaridum
  • schneider/max30001
  • schneider/stream-locks
  • ios-workarounds
  • schneider/fundamental-test
  • schneider/ble-buffers
  • schneider/maxim-sdk-update
  • ch3/splashscreen
  • koalo/bhi160-works-but-dirty
  • koalo/wip/i2c-for-python
  • 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
34 results

ble.c

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    ble.c 6.87 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 "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;
    	}
    
    	return FALSE;