2016-09-06 09:47 AM
This is more of a C problem than Arm problem, here too are some people who know their C.
I am reading the value of DWT_CYCCNT; When print it via Uart, after a while it becomes negative. The most signicant bit becomes 1, but how to tell it to the compiler that it is not a sign.//the declaration
char
klaa[40];
//the code
while
(1)
{
kellopulshit = *DWT_CYCCNT;
sprintf
(klaa,
''Clock pulses %d \n''
, kellopulshit);
c=
strlen
(klaa);
HAL_UART_Transmit(&huart2,(uint8_t *) klaa,c,1000);
2016-09-06 10:08 AM
whats the type of
kellopulshit
try %u for unsigned int
2016-09-06 10:28 AM
It is unsigned int
I'll try the %u a bit later. At least it didn't give an error2016-09-06 10:45 AM
It works, thanks.