wip
This commit is contained in:
38
workspace/AUTOM10/Core/Src/debug.c
Normal file
38
workspace/AUTOM10/Core/Src/debug.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* debug.c
|
||||
*
|
||||
* Created on: Apr 20, 2026
|
||||
* Author: user
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "main.h"
|
||||
|
||||
extern UART_HandleTypeDef huart1;
|
||||
extern uint8_t pulsanti;
|
||||
extern uint16_t stPulsanti;
|
||||
extern omCiclo_st stCiclo;
|
||||
|
||||
void debug(void){
|
||||
static uint8_t mempulsanti=0;
|
||||
static uint16_t memstPulsanti=0;
|
||||
static omCiclo_st memstCiclo=omchiuso;
|
||||
char s [100];
|
||||
|
||||
if(mempulsanti!=pulsanti){
|
||||
mempulsanti=pulsanti;
|
||||
sprintf(s,"\npulsanti=%X",pulsanti);
|
||||
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
|
||||
}
|
||||
if(memstPulsanti!=stPulsanti){
|
||||
memstPulsanti=stPulsanti;
|
||||
sprintf(s,"\nstpulsanti=%X",stPulsanti);
|
||||
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
|
||||
}
|
||||
if(memstCiclo!=stCiclo){
|
||||
memstCiclo=stCiclo;
|
||||
sprintf(s,"\nstCiclo=%d",stCiclo);
|
||||
HAL_UART_Transmit(&huart1,(uint8_t*) s, strlen(s), HAL_MAX_DELAY);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user