- First complete version of firmware. Currently being tested in the rehearsal room
- Added bunch of screens, fonts and images - Added script to read out frame buffer (function currently disabled in Firmware)
This commit is contained in:
55
Firmware/Convert.c
Normal file
55
Firmware/Convert.c
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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
|
||||
*******************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user