펌웨어 하실 때 2진수 변환 할 때 짜증나실 경우 걍 이거 쓰시면 됩니다. :)
oct2bin(unsigned int n)
{
if (n) oct2bin (n>>1);
data[oct_i]=(1&n);
oct_i++;
}
#include < stdio.h>
void dec2bin(int n)
{
if (n>1)
dec2bin(n/2);
printf("%d",n%2);
}
void dec2octal(int n)
{
if (n>1)
dec2octal(n/8);
printf("%d",n%8);
}