|
|
|
@ -21,6 +21,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
/* Private includes ----------------------------------------------------------*/
|
|
|
|
/* Private includes ----------------------------------------------------------*/
|
|
|
|
/* USER CODE BEGIN Includes */
|
|
|
|
/* USER CODE BEGIN Includes */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include "disp7seg.h"
|
|
|
|
#include "disp7seg.h"
|
|
|
|
@ -82,6 +83,18 @@ static inline uint32_t TickChk(uint32_t *tref, int_fast16_t tcycle) {
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************//**
|
|
|
|
|
|
|
|
* @brief Retargets the C library printf function to the USART.
|
|
|
|
|
|
|
|
* @param file: The file handle (not used, can be ignored).
|
|
|
|
|
|
|
|
* @param ptr: Pointer to the data buffer to be transmitted.
|
|
|
|
|
|
|
|
* @param len: Length of the data buffer.
|
|
|
|
|
|
|
|
* @retval The number of bytes transmitted.
|
|
|
|
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
int _write(int file, char *ptr, int len) {
|
|
|
|
|
|
|
|
Uart5_PutData(ptr, len);
|
|
|
|
|
|
|
|
return len;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* USER CODE END 0 */
|
|
|
|
/* USER CODE END 0 */
|
|
|
|
@ -142,8 +155,7 @@ int main(void)
|
|
|
|
ShiftReg_Update();
|
|
|
|
ShiftReg_Update();
|
|
|
|
|
|
|
|
|
|
|
|
Uart5_Init();
|
|
|
|
Uart5_Init();
|
|
|
|
char* s = "Hello, world!\r\n";
|
|
|
|
printf("Hello printf\n");
|
|
|
|
Uart5_PutData(s, strlen(s));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* USER CODE END 2 */
|
|
|
|
/* USER CODE END 2 */
|
|
|
|
|
|
|
|
|
|
|
|
@ -163,7 +175,11 @@ int main(void)
|
|
|
|
DispPutDigit(1, 'a'+cnt, 1);
|
|
|
|
DispPutDigit(1, 'a'+cnt, 1);
|
|
|
|
DispPutDigit(2, 'A'+cnt, 0);
|
|
|
|
DispPutDigit(2, 'A'+cnt, 0);
|
|
|
|
cnt = (cnt + 1) % 16;
|
|
|
|
cnt = (cnt + 1) % 16;
|
|
|
|
Uart5_PutByte('0' + cnt);
|
|
|
|
static uint32_t Trefus = 0;
|
|
|
|
|
|
|
|
uint32_t t = usTimerGetAbs();
|
|
|
|
|
|
|
|
uint32_t tdif = t - Trefus;
|
|
|
|
|
|
|
|
printf("%6luus\n", tdif);
|
|
|
|
|
|
|
|
Trefus = t;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static uint32_t Tick100msRef = 0;
|
|
|
|
static uint32_t Tick100msRef = 0;
|
|
|
|
|