# HG changeset patch # User Mychaela Falconia # Date 1619308073 0 # Node ID 77b980f09bd90dd7004cc41a8d8fec5f2e9222a4 # Parent 6541e43f88e569b6adc336a7693acf523fd675ba Condat backlight driver switched to use the new R2D on/off API diff -r 6541e43f88e5 -r 77b980f09bd9 src/condat/com/src/driver/light.c --- a/src/condat/com/src/driver/light.c Sat Apr 24 23:38:18 2021 +0000 +++ b/src/condat/com/src/driver/light.c Sat Apr 24 23:47:53 2021 +0000 @@ -56,9 +56,8 @@ #endif -#include "main/sys_types.h" #include "fc-target.h" -#include "armio.h" +#include "r2d/r2d_blrr_api.h" #include "lls/lls_api.h" /*==== EXPORT =====================================================*/ @@ -69,7 +68,6 @@ /* forward declaration for static functions */ static void keypad_bl_on(void); static void keypad_bl_off(void); -static void blrr_display_ctrl(UBYTE set_state); /*==== CONSTANTS ==================================================*/ /* @@ -91,11 +89,6 @@ { backlight_status = LIGHT_STATUS_OFF; -#ifdef CONFIG_TARGET_LUNA - /* PWL module clock enable */ - *(volatile SYS_UWORD8 *)0xFFFE8001 = 0x01; -#endif - return DRV_OK; } @@ -216,62 +209,3 @@ } #endif - -/******************************************************************************* - -BLRR display (backlight required for readability) on/off control; -the plan is to have this control eventually moved to R2D task. - -*******************************************************************************/ - -#ifdef CONFIG_TARGET_LUNA - -static void blrr_display_ctrl(UBYTE set_state) -{ - UBYTE on_off; - - /* PWL indication for development */ - switch (set_state) { - case LIGHT_STATUS_OFF: - *(volatile SYS_UWORD8 *)0xFFFE8000 = 0; - on_off = 0; - break; - case LIGHT_STATUS_ON: - *(volatile SYS_UWORD8 *)0xFFFE8000 = 255; - on_off = 1; - break; - case LIGHT_STATUS_INCALL: - *(volatile SYS_UWORD8 *)0xFFFE8000 = 16; - on_off = 1; - break; - case LIGHT_STATUS_CHG_BOOT: - *(volatile SYS_UWORD8 *)0xFFFE8000 = 64; - on_off = 1; - break; - default: - return; /* error, but we are a void function */ - } - /* physical backlight on/off */ - if (on_off) - AI_SetBit(9); - else - AI_ResetBit(9); -} - -#elif defined(CONFIG_TARGET_C139) - -static void blrr_display_ctrl(UBYTE set_state) -{ - if (set_state != LIGHT_STATUS_OFF) - AI_SetBit(1); - else - AI_ResetBit(1); -} - -#else - -static void blrr_display_ctrl(UBYTE set_state) -{ -} - -#endif