/*
 * PWM.c
 *
 *  Created on: 2024. 07. 05.
 *      Author: SUPYO
 */


#include <Operation_Layer/Lamp/PWM.h>
#include "Global_Variable.h"
#include "can.h"
#include "board.h"



void PWM_for_dirve_mode(void)
{
	switch(GV_VCU_Drive_Mode)
	{
		case 0:
			switch(GV_PWM_2)
			{
				case 0:
					Set_PWM_Duty(PWM_CH0, 0);
					Set_PWM_Duty(PWM_CH1, 100);	// 0.2초 주기로 점멸 변경
					GV_PWM_1 = 0;
					GV_PWM_2 = 1;
					break;
				default:
					Set_PWM_Duty(PWM_CH0, 0);
					Set_PWM_Duty(PWM_CH1, 0);
					GV_PWM_1 = 0;
					GV_PWM_2 = 0;
					break;
			}
			break;
		case 1:
			switch(GV_PWM_1)
			{
				case 0:
					Set_PWM_Duty(PWM_CH0, 100); // 0.2초 주기로 점멸 변경
					Set_PWM_Duty(PWM_CH1, 0);
					GV_PWM_1 = 1;
					GV_PWM_2 = 0;
					break;
				default:
					Set_PWM_Duty(PWM_CH0, 0);
					Set_PWM_Duty(PWM_CH1, 0);
					GV_PWM_1 = 0;
					GV_PWM_2 = 0;
					break;
			}
			break;
		default:
			Set_PWM_Duty(PWM_CH0, 0);
			Set_PWM_Duty(PWM_CH1, 0);
			GV_PWM_1 = 0;
			GV_PWM_2 = 0;
			break;
	}
}
