0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-18 22:29:50 +03:00

Fix TX power setting (I broke it previous commit)

This commit is contained in:
OneOfEleven
2023-10-08 23:08:18 +01:00
parent 0bb34d230c
commit 16d51300d9
18 changed files with 215 additions and 157 deletions

View File

@ -14,11 +14,14 @@
* limitations under the License.
*/
#include <string.h>
#include <stdbool.h>
#include "bsp/dp32g030/dma.h"
#include "bsp/dp32g030/syscon.h"
#include "bsp/dp32g030/uart.h"
#include "driver/uart.h"
#include "external/printf/printf.h"
static bool UART_IsLogEnabled;
uint8_t UART_DMA_Buffer[256];
@ -92,8 +95,36 @@ void UART_Send(const void *pBuffer, uint32_t Size)
}
}
void UART_SendText(const void *str)
{
if (str)
UART_Send(str, strlen(str));
}
void UART_LogSend(const void *pBuffer, uint32_t Size)
{
if (UART_IsLogEnabled)
UART_Send(pBuffer, Size);
}
void UART_LogSendText(const void *str)
{
if (UART_IsLogEnabled && str)
UART_Send(str, strlen(str));
}
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
void UART_printf(const char *str, ...)
{
char text[256];
int len;
va_list va;
va_start(va, str);
len = vsnprintf(text, sizeof(text), str, va);
va_end(va);
UART_Send(text, len);
//UART_Send(text, strlen(text));
}
#endif

View File

@ -24,7 +24,12 @@ extern uint8_t UART_DMA_Buffer[256];
void UART_Init(void);
void UART_Send(const void *pBuffer, uint32_t Size);
void UART_SendText(const void *str);
void UART_LogSend(const void *pBuffer, uint32_t Size);
void UART_LogSendText(const void *str);
#if defined(ENABLE_UART) && defined(ENABLE_UART_DEBUG)
void UART_printf(const char *str, ...);
#endif
#endif