Synced the ZCD and ADCMock

This commit is contained in:
jakeg00dwin 2024-07-28 16:45:37 -07:00
parent 01e4c43481
commit f6aacf1dfa
3 changed files with 7 additions and 8 deletions

View File

@ -20,7 +20,8 @@
void ZCD_Setup(void)
{
ADC_Init(ZCD_PIN);
ADC_Enable(ZCD_PIN);
ADC_SetPin(ZCD_PIN);
ADC_Enable();
}
bool ZCD_IsTriggered()

View File

@ -30,17 +30,16 @@ TEST_GROUP(test_MockADC)
TEST(test_MockADC, ADC_InitExpects)
{
mock().expectOneCall("ADC_Init")
.withUnsignedIntParameter("pin_num", 0x2);
.withUnsignedIntParameter("pin_num", 7);
ADC_Init(0x2);
ADC_Init(7);
}
TEST(test_MockADC, ADC_EnableExpects)
{
mock().expectOneCall("ADC_Enable")
.withUnsignedIntParameter("pin_num", 0x2);
mock().expectOneCall("ADC_Enable");
ADC_Enable(0x2);
ADC_Enable();
}

View File

@ -38,8 +38,7 @@ static void ZCDSetupExpectations(void)
mock().expectOneCall("ADC_Init")
.withUnsignedIntParameter("pin_num", 7);
mock().expectOneCall("ADC_Enable")
.withUnsignedIntParameter("pin_num", 7);
mock().expectOneCall("ADC_Enable");
}