Porting PicoTCP WIP

This commit is contained in:
2025-10-29 14:29:06 +01:00
parent 6722f42e68
commit 815c2239fe
464 changed files with 235009 additions and 24 deletions

View File

@ -0,0 +1,58 @@
/*********************************************************************
PicoTCP. Copyright (c) 2014-2017 Altran Intelligent Systems. Some rights reserved.
See COPYING, LICENSE.GPLv2 and LICENSE.GPLv3 for usage.
*********************************************************************/
#ifndef _INCLUDE_PICO_ESP8266
#define _INCLUDE_PICO_ESP8266
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "pico_constants.h"
/* -------------- DEBUG ------------- */
/* #define dbg(...) */
#define dbg printf
/* -------------- MEMORY ------------- */
extern void *pvPortMalloc( size_t xWantedSize );
extern void vPortFree( void *pv );
#define pico_free vPortFree
static inline void *pico_zalloc(size_t size)
{
void *ptr = (void *)pvPortMalloc(size);
if(ptr)
memset(ptr, 0u, size);
return ptr;
}
/* -------------- TIME ------------- */
extern volatile uint32_t esp_tick;
static inline pico_time PICO_TIME_MS(void)
{
return (pico_time) esp_tick;
}
static inline pico_time PICO_TIME(void)
{
return PICO_TIME_MS() / 1000;
}
static inline void PICO_IDLE(void)
{
uint32_t now = esp_tick;
while (now == esp_tick)
;
}
#endif