- Added bunch of screens, fonts and images - Added script to read out frame buffer (function currently disabled in Firmware)
56 lines
1.4 KiB
C
56 lines
1.4 KiB
C
/*
|
|
* Convert.c
|
|
*
|
|
* Created: Tue Feb 22 2022 20:31:44
|
|
* Author Chris
|
|
*/
|
|
// ============================================================================================
|
|
// Includes
|
|
#include "Convert.h"
|
|
|
|
|
|
// ============================================================================================
|
|
// Defines
|
|
|
|
|
|
// ============================================================================================
|
|
// Variables
|
|
|
|
|
|
// ============================================================================================
|
|
// Function Declarations
|
|
|
|
|
|
/*******************************************************************
|
|
Functions
|
|
*******************************************************************/
|
|
int Convert_Char_To_Number(char input)
|
|
{
|
|
int Result_Number = 0;
|
|
|
|
if(input>='a' && input<='f') { Result_Number = (input-'a'+10); }
|
|
else if(input>='A' && input<='F') { Result_Number = (input-'A'+10); }
|
|
else if(input>='0' && input<='9') { Result_Number = (input-'0'); }
|
|
|
|
return Result_Number;
|
|
}
|
|
|
|
int Convert_CharArray_To_Number(char input[], int length)
|
|
{
|
|
int i;
|
|
int Result_Number = 0;
|
|
|
|
for(i=0;i<length;i++)
|
|
{
|
|
Result_Number += (Convert_Char_To_Number(input[i]) << (4*(length-1-i)));
|
|
}
|
|
|
|
return Result_Number;
|
|
}
|
|
|
|
|
|
/*******************************************************************
|
|
Internal Functions
|
|
*******************************************************************/
|
|
|