Initial commit: TXW82x FPV v2.7.0.7-42229 SDK + project sources
This commit is contained in:
31
csky/hgic/malloc.c
Normal file
31
csky/hgic/malloc.c
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "sys_config.h"
|
||||
#include "typesdef.h"
|
||||
#include "list.h"
|
||||
#include "dev.h"
|
||||
#include "devid.h"
|
||||
#include "osal/string.h"
|
||||
#include "hal/uart.h"
|
||||
#include "lib/heap/sysheap.h"
|
||||
|
||||
#include "csi_core.h"
|
||||
|
||||
#if MPOOL_ALLOC
|
||||
void *krhino_mm_alloc(size_t size, void *caller)
|
||||
{
|
||||
#if defined(PSRAM_HEAP) && defined(PSRAM_TASK_STACK)
|
||||
return sysheap_alloc(&psram_heap, size, caller, 0);
|
||||
#else
|
||||
return sysheap_alloc(&sram_heap, size, caller, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void krhino_mm_free(void *ptr)
|
||||
{
|
||||
#if defined(PSRAM_HEAP) && defined(PSRAM_TASK_STACK)
|
||||
os_free_psram(ptr);
|
||||
#else
|
||||
os_free(ptr);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
22
csky/hgic/usart.c
Normal file
22
csky/hgic/usart.c
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "sys_config.h"
|
||||
#include "typesdef.h"
|
||||
#include "list.h"
|
||||
#include "dev.h"
|
||||
#include "devid.h"
|
||||
#include "osal/string.h"
|
||||
#include "hal/uart.h"
|
||||
|
||||
#include "csi_core.h"
|
||||
|
||||
extern uint8_t __print_ctrl__;
|
||||
int32_t csi_usart_getchar(void* handle, uint8_t *ch)
|
||||
{
|
||||
*ch = uart_getc((struct uart_device *)handle);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int32_t csi_usart_putchar(void* handle, uint8_t ch)
|
||||
{
|
||||
if (__print_ctrl__&0x01) { return 0; }
|
||||
return uart_putc((struct uart_device *)handle, ch);
|
||||
}
|
||||
Reference in New Issue
Block a user