diff --git a/src/zero_cross_detection/zero_cross_detection.c b/src/zero_cross_detection/zero_cross_detection.c index a65bb2e..7b81e1e 100644 --- a/src/zero_cross_detection/zero_cross_detection.c +++ b/src/zero_cross_detection/zero_cross_detection.c @@ -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() diff --git a/tests/MockADC/test_MockADC.cpp b/tests/MockADC/test_MockADC.cpp index c2a86ea..8b0b5ee 100644 --- a/tests/MockADC/test_MockADC.cpp +++ b/tests/MockADC/test_MockADC.cpp @@ -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(); } diff --git a/tests/zero_cross_detection/test_zero_cross_detection.cpp b/tests/zero_cross_detection/test_zero_cross_detection.cpp index 5bb17ab..2b7d6e5 100644 --- a/tests/zero_cross_detection/test_zero_cross_detection.cpp +++ b/tests/zero_cross_detection/test_zero_cross_detection.cpp @@ -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"); }