Test using _printTaskStackHighWaterMark() function.

This commit is contained in:
aixiao 2024-04-15 15:32:58 +08:00
parent d5748a02c1
commit e59a423d2c
6 changed files with 19 additions and 6 deletions

View File

@ -1,5 +1,6 @@
#include "EC800M_GPS.h" #include "EC800M_GPS.h"
#include "EC800M_4G.h" #include "EC800M_4G.h"
#include "common.h"
int _r = 0; int _r = 0;
int _timeout = 1; int _timeout = 1;
@ -357,6 +358,7 @@ int EC800M_4G_RECV(char *string)
void EC800M_4G(void *p) void EC800M_4G(void *p)
{ {
//_printTaskStackHighWaterMark();
(void)p; (void)p;
EC800M_UART_INIT(); EC800M_UART_INIT();
@ -375,6 +377,7 @@ void EC800M_4G(void *p)
// GPS Module // GPS Module
EC800M_GPS(NULL); EC800M_GPS(NULL);
//_printTaskStackHighWaterMark();
vTaskDelay(pdMS_TO_TICKS(3000)); // 非阻塞延时 vTaskDelay(pdMS_TO_TICKS(3000)); // 非阻塞延时
} }

View File

@ -246,6 +246,7 @@ void EC800M_GPS(void *p)
} }
printf("\n"); printf("\n");
//_printTaskStackHighWaterMark();
vTaskDelay(pdMS_TO_TICKS(3000)); // 非阻塞延时 vTaskDelay(pdMS_TO_TICKS(3000)); // 非阻塞延时
//} //}

View File

@ -91,6 +91,7 @@ void HC_04_UART_READ(void *p)
void HC_04(void *p) void HC_04(void *p)
{ {
//_printTaskStackHighWaterMark();
(void)p; (void)p;
HC_04_UART_INIT(1); HC_04_UART_INIT(1);
while (1) { while (1) {
@ -98,6 +99,7 @@ void HC_04(void *p)
HC_04_UART_READ(NULL); HC_04_UART_READ(NULL);
printf("\n"); printf("\n");
//_printTaskStackHighWaterMark();
vTaskDelay(pdMS_TO_TICKS(3000)); // 非阻塞延时 vTaskDelay(pdMS_TO_TICKS(3000)); // 非阻塞延时
} }

View File

@ -219,7 +219,7 @@ void read_data(void)
void IM1253B(void *p) void IM1253B(void *p)
{ {
(void)p; (void)p;
//_printTaskStackHighWaterMark();
IM1253B_INIT(); IM1253B_INIT();
while (1) { while (1) {
printf("IM1253B\n"); printf("IM1253B\n");
@ -248,7 +248,7 @@ void IM1253B(void *p)
// 打印处理后的数据 // 打印处理后的数据
//Print_data(); //Print_data();
//_printTaskStackHighWaterMark();
vTaskDelay(pdMS_TO_TICKS(3000)); // 非阻塞延时 vTaskDelay(pdMS_TO_TICKS(3000)); // 非阻塞延时
} }

View File

@ -1,4 +1,5 @@
#include "PN532.h" #include "PN532.h"
#include "common.h"
int PN532_INIT(void) int PN532_INIT(void)
{ {
@ -14,6 +15,7 @@ int PN532_INIT(void)
void PN532(void *p) void PN532(void *p)
{ {
_printTaskStackHighWaterMark();
(void)p; (void)p;
PN532_INIT(); PN532_INIT();
@ -64,6 +66,7 @@ void PN532(void *p)
printf("UID: 0X%X 0X%X 0X%X 0X%X\r\n", PN532_DATA[14 - 1], PN532_DATA[15 - 1], PN532_DATA[16 - 1], PN532_DATA[17 - 1]); printf("UID: 0X%X 0X%X 0X%X 0X%X\r\n", PN532_DATA[14 - 1], PN532_DATA[15 - 1], PN532_DATA[16 - 1], PN532_DATA[17 - 1]);
printf("\n"); printf("\n");
_printTaskStackHighWaterMark();
vTaskDelay(pdMS_TO_TICKS(3000)); // 非阻塞延时 vTaskDelay(pdMS_TO_TICKS(3000)); // 非阻塞延时
} }
return; return;

View File

@ -26,12 +26,16 @@ void Led_Blinky(void *pvParameters)
gpio_init(LED_PIN); gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT); gpio_set_dir(LED_PIN, GPIO_OUT);
//_printTaskStackHighWaterMark();
while (1) { while (1) {
vTaskDelay(pdMS_TO_TICKS(500)); vTaskDelay(pdMS_TO_TICKS(500));
gpio_put(LED_PIN, 1); gpio_put(LED_PIN, 1);
vTaskDelay(pdMS_TO_TICKS(500)); vTaskDelay(pdMS_TO_TICKS(500));
gpio_put(LED_PIN, 0); gpio_put(LED_PIN, 0);
//_printTaskStackHighWaterMark();
} }
} }
@ -43,7 +47,7 @@ void Read_Onboard_Temperature(void *pvParameters)
adc_set_temp_sensor_enabled(true); adc_set_temp_sensor_enabled(true);
adc_select_input(4); // Input 4 is the onboard temperature sensor. adc_select_input(4); // Input 4 is the onboard temperature sensor.
_printTaskStackHighWaterMark(); //_printTaskStackHighWaterMark();
while (1) { while (1) {
const float conversionFactor = 3.3f / (1 << 12); const float conversionFactor = 3.3f / (1 << 12);
@ -53,7 +57,7 @@ void Read_Onboard_Temperature(void *pvParameters)
printf("Onboard temperature %.02f°C %.02f°F\n", tempC, (tempC * 9 / 5 + 32)); printf("Onboard temperature %.02f°C %.02f°F\n", tempC, (tempC * 9 / 5 + 32));
_printTaskStackHighWaterMark(); //_printTaskStackHighWaterMark();
vTaskDelay(pdMS_TO_TICKS(3000)); // 非阻塞延时 vTaskDelay(pdMS_TO_TICKS(3000)); // 非阻塞延时
} }
@ -86,7 +90,7 @@ int main(void)
{ {
printf("Temperature Task Error!"); printf("Temperature Task Error!");
} }
/*
// IM1253B 电压、功率模块 // IM1253B 电压、功率模块
xReturned = xTaskCreate(IM1253B, "IM1253B task", 1024, NULL, tskIDLE_PRIORITY, &IM1253B_xHandle); xReturned = xTaskCreate(IM1253B, "IM1253B task", 1024, NULL, tskIDLE_PRIORITY, &IM1253B_xHandle);
if (xReturned == errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY) if (xReturned == errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY)
@ -114,7 +118,7 @@ int main(void)
{ {
printf("HC-04 Task Error!"); printf("HC-04 Task Error!");
} }
*/
vTaskStartScheduler(); vTaskStartScheduler();
return 0; return 0;