testing some simple math examples

This commit is contained in:
Janosch
2022-10-10 17:40:57 +01:00
parent a6f275b742
commit 0e43f2bf8c
6 changed files with 46 additions and 13 deletions
+14
View File
@@ -29,3 +29,17 @@ static void DisableAll()
DigIo::ch2ena_out.Clear();
DigIo::ch3ena_out.Clear();
}
static void CalcTotals()
{
s32fp totalCurrent = Param::Get(Param::c1idc) + Param::Get(Param::c2idc) + Param::Get(Param::c3idc);
Param::SetFixed(Param::idc, totalCurrent);
s32fp u1 = Param::Get(Param::c1udc);
s32fp u2 = Param::Get(Param::c2udc);
s32fp u3 = Param::Get(Param::c3udc);
s32fp udcmax = MAX(u1, MAX(u2, u3));
Param::SetFixed(Param::udc, udcmax);
}