uint32_t INPUT_ARRAY[40];
#define INPUT_X INPUT_ARRAY[0] // input 1 corresponds to the first array slot and so on, easy to call up a specific input.
void main(){
while(1) // infinite loop for embedded program
{
Read_Inputs(); // input read function
Write_Outputs(); // output write function
Logic_Test(); // This is to test out the inputs and outputs on our hardware test rig
}
}
inline void Logic_Test(void){
if ( INPUT_1 != 0){
output_3 |= some_bit // this logic could change
output_10 |= another_bit
}
if ( INPUT_2 != 0){
output_x |= some_bit
}
if ( INPUT_3 != 0){
output_x |= some_bit
}
if ( INPUT_4 != 0){
output_x |= some_bit // this logic could change
}
if ( INPUT_X != 0){
output_x |= some_bit // this logic could change
}
// ... repeated for all 40 inputs
if ( INPUT_40 != 0){
output_x |= some_bit
}
}
uint32_t INPUT_ARRAY[40];
#define INPUT_X INPUT_ARRAY[0] // input 1 corresponds to the first array slot and so on, easy to call up a specific input.
void main(){
while(1) // infinite loop for embedded program
{
Read_Inputs(); // input read function
Write_Outputs(); // output write function
Logic_Test(); // This is to test out the inputs and outputs on our hardware test rig
}
}
inline void Logic_Test(void){
if ( INPUT_1 != 0){
output_3 |= some_bit // this logic could change
output_10 |= another_bit
}
if ( INPUT_2 != 0){
output_x |= some_bit
}
if ( INPUT_3 != 0){
output_x |= some_bit
}
if ( INPUT_4 != 0){
output_x |= some_bit // this logic could change
}
if ( INPUT_X != 0){
output_x |= some_bit // this logic could change
}
// ... repeated for all 40 inputs
if ( INPUT_40 != 0){
output_x |= some_bit
}
}