mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-05-04 07:10:17 +00:00
fix print
This commit is contained in:
parent
0066eafb86
commit
f95cc281f1
@ -13,6 +13,7 @@ void print(char* str){
|
||||
size++;
|
||||
}
|
||||
CDC_Transmit_FS((unsigned char*)str, size);
|
||||
HAL_Delay(1);
|
||||
}
|
||||
|
||||
void int_to_str(int number, char *str, int base)
|
||||
@ -37,6 +38,11 @@ void int_to_str(int number, char *str, int base)
|
||||
*--ptr = '-';
|
||||
}
|
||||
|
||||
// Дополнение ведущим нулем для шестнадцатеричных чисел
|
||||
if (base == 16 && (buffer + sizeof(buffer) - 1 - ptr) == 1) {
|
||||
*--ptr = '0';
|
||||
}
|
||||
|
||||
strcpy(str, ptr);
|
||||
}
|
||||
|
||||
@ -50,4 +56,5 @@ void printNumber(long int number)
|
||||
|
||||
// Отправка строки через USB CDC
|
||||
CDC_Transmit_FS((uint8_t*)buffer, strlen(buffer));
|
||||
HAL_Delay(1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user