initial check in based on SVN revision 575

This commit is contained in:
2025-05-14 12:57:39 -05:00
commit a3ef12e24a
217 changed files with 95547 additions and 0 deletions

54
source/measure.c Normal file
View File

@@ -0,0 +1,54 @@
/*
* measure.c
*
* Created on: Jun 7, 2022
* Author: Keith.Lloyd
*/
#include "fsl_spi.h"
#include "pin_mux.h"
#include "board.h"
#include "fsl_debug_console.h"
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
#include <string.h>
#include <stdint.h>
#include <arm_math.h>
#include "measure.h"
#include "frq.h"
#include "ports.h"
#include "adc.h"
#include "amps.h"
extern float32_t Volts;
extern float32_t Amps;
extern float32_t Ohms;
extern float32_t Watts,Max_Power_Limit;
extern uint8_t frequency;
extern uint8_t Port_State[];
extern ADC_t adc;
float Calc_Max_current(void)
{
float a;
if(freqArray[frequency].frequency1 <= MAX_DTYPE)
a = sqrtf(Max_Power_Limit / adc.Ohms_slowfilt);
else
a = sqrtf(1/adc.Ohms_slowfilt);
return(a);
}