/* Clears RTC compare match flag. 
Clears the compare flag. The compare flag is set when there is a compare match between the counter and the compare. */
enum status_code rtc_count_clear_compare_match(struct rtc_module *const module, const enum rtc_count_compare comp_index)
/* Clears RTC compare match flag. 
Clears the compare flag. The compare flag is set when there is a compare match between the counter and the compare. */
enum status_code rtc_count_clear_compare_match(struct rtc_module *const module, const enum rtc_count_compare comp_index)
{
	Assert(module);
	Assert(module->hw);
	Rtc *const rtc_module = module->hw;
	switch (module->mode){
		case RTC_COUNT_MODE_32BIT:
			if (comp_index > RTC_NUM_OF_COMP32) {
				return STATUS_ERR_INVALID_ARG;
			}
			break;
		case RTC_COUNT_MODE_16BIT:
			if (comp_index > RTC_NUM_OF_COMP16) {
				return STATUS_ERR_INVALID_ARG;
			}
			break;
		default:
			Assert(false);
			return STATUS_ERR_BAD_FORMAT;
	}
	rtc_module->MODE0.INTFLAG.reg = RTC_MODE1_INTFLAG_CMP(1 << comp_index);
	return STATUS_OK;
}