initial commit
This commit is contained in:
parent
5457e799f5
commit
ff95ee6537
14
int_to_bcd.c
Normal file
14
int_to_bcd.c
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include "mc8051fun.h"
|
||||||
|
|
||||||
|
uint16_t int_to_bcd(uint16_t i)
|
||||||
|
{
|
||||||
|
uint16_t b;
|
||||||
|
b = i%10;
|
||||||
|
i/=10;
|
||||||
|
b |= (i%10)<<4;
|
||||||
|
i/=10;
|
||||||
|
b |= (i%10)<<8;
|
||||||
|
i/=10;
|
||||||
|
b |= (i%10)<<12;
|
||||||
|
return b;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user