summaryrefslogtreecommitdiff
path: root/FreeRTOS-Plus/Test/CMock/examples/temp_sensor/src/AdcModel.c
diff options
context:
space:
mode:
Diffstat (limited to 'FreeRTOS-Plus/Test/CMock/examples/temp_sensor/src/AdcModel.c')
-rw-r--r--FreeRTOS-Plus/Test/CMock/examples/temp_sensor/src/AdcModel.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/FreeRTOS-Plus/Test/CMock/examples/temp_sensor/src/AdcModel.c b/FreeRTOS-Plus/Test/CMock/examples/temp_sensor/src/AdcModel.c
new file mode 100644
index 000000000..ad9111d2c
--- /dev/null
+++ b/FreeRTOS-Plus/Test/CMock/examples/temp_sensor/src/AdcModel.c
@@ -0,0 +1,33 @@
+#include "AdcModel.h"
+#include "TaskScheduler.h"
+#include "TemperatureCalculator.h"
+#include "TemperatureFilter.h"
+
+bool AdcModel_DoGetSample(void)
+{
+ return TaskScheduler_DoAdc();
+}
+
+void AdcModel_ProcessInput(uint16 millivolts)
+{
+ TemperatureFilter_ProcessInput(TemperatureCalculator_Calculate(millivolts));
+}
+
+bool AdcModel_DoNothingExceptTestASpecialType(EXAMPLE_STRUCT_T ExampleStruct)
+{
+ //This doesn't really do anything. it's only here to make sure I can compare a struct.
+ return FALSE;
+}
+bool AdModel_DoNothingExceptTestPointers(uint32* pExample)
+{
+ //This doesn't really do anything. it's only here to make sure I can compare a pointer value.
+ return FALSE;
+}
+
+EXAMPLE_STRUCT_T AdcModel_DoNothingExceptReturnASpecialType(void)
+{
+ EXAMPLE_STRUCT_T example; //again, this just is here to test that I can return a struct
+ example.x = 99;
+ example.y = 1;
+ return example;
+}