
{trigger:kw_scheinwerfer_toggle}
	(L.L.lights_sw_abbl) ! (S.L.lights_sw_abbl)
{end}

{trigger:kw_blinker_aus}
	(T.L.ev_lights_blinker_swoff)
	0 (S.L.lights_sw_blinker)
{end}

{trigger:kw_blinker_links}
	1 (S.L.lights_sw_blinker)
	(M.L.lights_startblinkgeber)
{end}

{trigger:kw_blinker_rechts}
	2 (S.L.lights_sw_blinker)
	(M.L.lights_startblinkgeber)
{end}

{trigger:kw_blinker_warn}
	3 (S.L.lights_sw_blinker)
	0 (S.L.lights_blinkautom_l_armed)
	0 (S.L.lights_blinkautom_r_armed)
	(M.L.lights_startblinkgeber)
{end}

{macro:lights_frame}
	(M.L.lights_runblinkgeber)

	(L.L.lights_sw_abbl)
		(S.L.lights_abbl)
		(S.L.lights_stand)
		(S.L.lights_rueck)
		(S.L.lights_nebelschluss)
		(S.L.lights_fern)

	(L.L.Brake)
		(S.L.lights_brems)

	(L.L.antrieb_getr_gangwahl) 0 =
		(S.L.lights_rueckfahr)

	(L.L.lights_sw_blinker) s0 1 = l0 3 = || (L.L.lights_blinkgeber) &&
		(S.L.lights_blinker_l)

	(L.L.lights_sw_blinker) 2 >= (L.L.lights_blinkgeber) &&
		(S.L.lights_blinker_r)

'Automatische Blinkerabschaltung:

	(L.L.Axle_Steering_0_L) (C.L.lights_blinkautom_minLenk) > (L.L.lights_sw_blinker) 2 = &&
	{if}
		1 (S.L.lights_blinkautom_r_armed)
	{else}
		(L.L.lights_blinkautom_r_armed)
		{if}
			(T.L.ev_lights_blinker_swoff)
			0
				(S.L.lights_sw_blinker)
				(S.L.lights_blinkautom_r_armed)
		{endif}
	{endif}

	(L.L.Axle_Steering_0_L) /-/ (C.L.lights_blinkautom_minLenk) > (L.L.lights_sw_blinker) 1 = &&
	{if}
		1 (S.L.lights_blinkautom_l_armed)
	{else}
		(L.L.lights_blinkautom_l_armed)
		{if}
			(T.L.ev_lights_blinker_swoff)
			0
				(S.L.lights_sw_blinker)
				(S.L.lights_blinkautom_l_armed)
		{endif}
	{endif}

{end}

{macro:lights_init}

{end}

{macro:lights_startblinkgeber}
	(L.L.lights_blinkgeber_nexttime) (L.S.Gettime) 1 - <
	{if}
		(T.L.ev_lights_blinker_on)
		(L.S.Gettime) (C.L.lights_blinkertime_firston) + (S.L.lights_blinkgeber_nexttime)
		1 (S.L.lights_blinkgeber)
	{endif}
{end}

{macro:lights_runblinkgeber}
	(L.S.Gettime) (L.L.lights_blinkgeber_nexttime) > (L.L.lights_sw_blinker) &&
	{if}
		(L.L.lights_blinkgeber) ! (S.L.lights_blinkgeber)
		{if}
			(T.L.ev_lights_blinker_on)
			(C.L.lights_blinkertime_on)
		{else}
			(T.L.ev_lights_blinker_off)
			(C.L.lights_blinkertime_off)
		{endif}
		(L.S.Gettime) + (S.L.lights_blinkgeber_nexttime)
	{endif}
{end}