| 1 | /**************************************************************************** |
|---|
| 2 | * NAME: App_Fnc_Power.c |
|---|
| 3 | *---------------------------------------------------------------------------- |
|---|
| 4 | * Copyright (c) DIGITAL STREAM Technology Inc. |
|---|
| 5 | *---------------------------------------------------------------------------- |
|---|
| 6 | * CREATED_BY: Do Gon Lee |
|---|
| 7 | * CREATION_DATE: 2009/07/08 |
|---|
| 8 | * $Author: foxhunt $ |
|---|
| 9 | * $Revision: 1.0 $ |
|---|
| 10 | * $Date: 2009/07/08 15:08:26 $ |
|---|
| 11 | *---------------------------------------------------------------------------- |
|---|
| 12 | * PURPOSE: |
|---|
| 13 | * - Power and Operation State management |
|---|
| 14 | *****************************************************************************/ |
|---|
| 15 | |
|---|
| 16 | /*_____ I N C L U D E __________________________________________*/ |
|---|
| 17 | |
|---|
| 18 | #include "App_Main.h" |
|---|
| 19 | |
|---|
| 20 | #if SUPPORT_POWEROFF |
|---|
| 21 | |
|---|
| 22 | #include "App_Proc.h" |
|---|
| 23 | #include "App_Fnc_Power.h" |
|---|
| 24 | #include "App_Res_Resources.h" |
|---|
| 25 | |
|---|
| 26 | #include "DHL_DBG.h" |
|---|
| 27 | #include "DHL_SYS_GPIO_List.h" |
|---|
| 28 | |
|---|
| 29 | #include "DHL_IO.h" |
|---|
| 30 | #include "DHL_UIO.h" |
|---|
| 31 | #include "DHL_PODIF.h" |
|---|
| 32 | |
|---|
| 33 | #if SUPPORT_UDCP |
|---|
| 34 | #include "DMW_ScteSiScan.h" |
|---|
| 35 | #endif |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | /*_____ D E F I N I T I O N ____________________________________*/ |
|---|
| 42 | |
|---|
| 43 | #if COMMENT |
|---|
| 44 | _____DbgPrint_____(){} |
|---|
| 45 | #endif |
|---|
| 46 | |
|---|
| 47 | DHL_MODULE("@f_pwr", 0); |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | #if COMMENT |
|---|
| 58 | ____Config____(){} |
|---|
| 59 | #endif |
|---|
| 60 | |
|---|
| 61 | /* |
|---|
| 62 | ÇÁ·Î±×·¥ ½ÃÀÛ°ú µ¿½Ã¿¡ setting µÉ power state. |
|---|
| 63 | */ |
|---|
| 64 | #if SUPPORT_MICOM |
|---|
| 65 | // ÀϹÝÀûÀ¸·Î MICOMÀÌ ¾ø´Â º¸µå´Â standby·Î ½ÃÀÛ. |
|---|
| 66 | // --> ÀÏ´Ü °³¹ß Áß¿¡´Â NORMAL·Î.. customer ÀÇ°ß ¹Ý¿µÇÒ °Í.. |
|---|
| 67 | #define DEFAULT_POWER_STATE eAPP_PS_NORMAL // eAPP_PS_ACTIVE_STANDBY |
|---|
| 68 | #define DEFAULT_OP_STATE eAPP_OP_CABLE_INB |
|---|
| 69 | #else |
|---|
| 70 | // MICOMÀÌ ÀÖ´Â º¸µå´Â standby µ¿ÀÛÀº MICOMÀÌ ¼öÇàÇϹǷΠ¹Ù·Î ONµÇ¸é µÊ. |
|---|
| 71 | #define DEFAULT_POWER_STATE eAPP_PS_NORMAL |
|---|
| 72 | #define DEFAULT_OP_STATE eAPP_OP_CABLE_INB |
|---|
| 73 | #endif // #if SUPPORT_UDCP |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | #if COMMENT |
|---|
| 80 | ____Types____(){} |
|---|
| 81 | #endif |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | #if COMMENT |
|---|
| 88 | ____Variables____(){} |
|---|
| 89 | #endif |
|---|
| 90 | |
|---|
| 91 | /* |
|---|
| 92 | this is saved to NvRam. |
|---|
| 93 | */ |
|---|
| 94 | static APP_POWER_STATE s_PowerState = eAPP_PS_INIT; |
|---|
| 95 | |
|---|
| 96 | #if SUPPORT_POD |
|---|
| 97 | static APP_OP_STATE s_OperationState = eAPP_OP_INIT; |
|---|
| 98 | #endif |
|---|
| 99 | |
|---|
| 100 | static BOOL bFirstboot; // óÀ½ ºÎÆÃÇÔÀ» ¾Ë·ÁÁÖ´Â Flag |
|---|
| 101 | |
|---|
| 102 | |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | /*_____ F U N C T I O N ________________________________________*/ |
|---|
| 107 | |
|---|
| 108 | #if COMMENT |
|---|
| 109 | ____Power_State____(){} |
|---|
| 110 | #endif |
|---|
| 111 | |
|---|
| 112 | void App_Pwr_ChangePowerState(APP_POWER_STATE state) |
|---|
| 113 | { |
|---|
| 114 | if ((UINT32)state >= eAPP_PS_MAX) { |
|---|
| 115 | dprint(0, "!! try changing to wrong power state %d\n", state); |
|---|
| 116 | return; |
|---|
| 117 | } |
|---|
| 118 | if (state == s_PowerState) { |
|---|
| 119 | dprint(0, "!! same power state\n"); |
|---|
| 120 | return; |
|---|
| 121 | } |
|---|
| 122 | APP_POWER_STATE prev = s_PowerState; |
|---|
| 123 | |
|---|
| 124 | // ÀϺΠÁö¿øÇÏÁö ¾Ê´Â power mode µéÀº À̰÷¿¡¼ ¼± ó¸®. |
|---|
| 125 | // |
|---|
| 126 | #if SUPPORT_MICOM |
|---|
| 127 | if (state == eAPP_PS_DEEP_STANDBY) |
|---|
| 128 | state == eAPP_PS_ACTIVE_STANDBY; |
|---|
| 129 | #else |
|---|
| 130 | if (state == eAPP_PS_ACTIVE_STANDBY) |
|---|
| 131 | state == eAPP_PS_DEEP_STANDBY; |
|---|
| 132 | #endif |
|---|
| 133 | |
|---|
| 134 | dprint(2, "PowerStateChange: %s (%d) --> %s (%d)\n", |
|---|
| 135 | APP_POWER_STATE_STR(prev), prev, APP_POWER_STATE_STR(state), state); |
|---|
| 136 | |
|---|
| 137 | if (state == eAPP_PS_DEEP_STANDBY) |
|---|
| 138 | { |
|---|
| 139 | // CPU Àü¿øÀº ²¨Áö¸é¼ MICOM¸¸ »ì¾Æ ÀÖ°Ô µÇ´Â mode. |
|---|
| 140 | // |
|---|
| 141 | // ´Ü, DHL ·¹º§¿¡¼ STANDBYÀÇ µ¿ÀÛÀº platform dependent ÇϹǷΠÁÖÀÇ!! |
|---|
| 142 | dprint(2, "Entering standby...\n"); |
|---|
| 143 | //dhl_dbg_flush_console(); |
|---|
| 144 | OS_Delay(OS_GetTicksPerSecond()/20); // ¸ðµç dbg message°¡ ´Ù Ãâ·Â µÇµµ·Ï ´ë±â.. |
|---|
| 145 | |
|---|
| 146 | DHL_UIO_Control(eDHL_UIO_CT_Indicator, eDHL_UIO_IT_Power, 0); |
|---|
| 147 | DHL_SYS_SystemCommand(DHL_SYS_STANDBY, 0); |
|---|
| 148 | } |
|---|
| 149 | else if (state == eAPP_PS_ACTIVE_STANDBY) |
|---|
| 150 | { |
|---|
| 151 | // ÇöÀç show_menu¿¡¼ º¸ÀÌ´Â ¸ðµç ¸Þ´º Á¦°Å |
|---|
| 152 | DMG_MenuExit_ActiveAll(); |
|---|
| 153 | // 2010.04.27 foxhut : ÀçºÎÆÃ ½Ã Ç×»ó ¶° ÀÖ¾î¾ß µÇ´Â ¸Þ´º¿¡ ´ëÇÑ check ÇÊ¿äÇÔ! (no ch guide µî..) |
|---|
| 154 | |
|---|
| 155 | // °¢Á¾ timer µéÀ» stop. |
|---|
| 156 | // sleep timer, no signal timer |
|---|
| 157 | // todo.. |
|---|
| 158 | |
|---|
| 159 | // AV Á¤Áö.. |
|---|
| 160 | App_ChTuneStopTV(); |
|---|
| 161 | |
|---|
| 162 | #if SUPPORT_MICOM |
|---|
| 163 | // display off |
|---|
| 164 | // turn off all video signals (DAC, modulator, etc..) |
|---|
| 165 | DHL_SYS_SetGpioDirection(DHL_GPIO_UDCP_ACT_PWR_SAVE_N, eDHL_GPIO_MODE_Output, 0); |
|---|
| 166 | |
|---|
| 167 | // make TV RF out to loop-thru. |
|---|
| 168 | // º¸µå¿¡¼ pull-up ÀÌ µÇ¾î ÀÖÀ¸¹Ç·Î input À¸·Î ¹Ù²ãµµ µÈ´Ù. |
|---|
| 169 | DHL_SYS_SetGpioDirection(DHL_GPIO_UDCP_RF_OUT_SEL, eDHL_GPIO_MODE_Input, 0); |
|---|
| 170 | #endif |
|---|
| 171 | |
|---|
| 172 | // HDMI disconnect |
|---|
| 173 | DHL_SYS_DisplayEnable(FALSE); |
|---|
| 174 | |
|---|
| 175 | // LED, VFD µî Ç¥½Ã |
|---|
| 176 | DHL_UIO_Control(eDHL_UIO_CT_Indicator, eDHL_UIO_IT_Power, 1); |
|---|
| 177 | |
|---|
| 178 | } |
|---|
| 179 | else if (state == eAPP_PS_NORMAL) |
|---|
| 180 | { |
|---|
| 181 | // LED |
|---|
| 182 | DHL_UIO_Control(eDHL_UIO_CT_Indicator, eDHL_UIO_IT_Power, 2); |
|---|
| 183 | |
|---|
| 184 | // HDMI |
|---|
| 185 | DHL_SYS_DisplayEnable(TRUE); |
|---|
| 186 | |
|---|
| 187 | #if SUPPORT_MICOM |
|---|
| 188 | // turn on all video signals in DHL level |
|---|
| 189 | DHL_SYS_SetGpioDirection(DHL_GPIO_UDCP_ACT_PWR_SAVE_N, eDHL_GPIO_MODE_Output, 1); |
|---|
| 190 | |
|---|
| 191 | // make TV RF out to CH 3/4 |
|---|
| 192 | DHL_SYS_SetGpioDirection(DHL_GPIO_UDCP_RF_OUT_SEL, eDHL_GPIO_MODE_Output, 0); |
|---|
| 193 | #endif |
|---|
| 194 | // boot logo °¡ ÇÊ¿äÇϸé drawing.. ÇÏÁö¸¸ ÀÌ ½ÃÁ¡Àº ³Ê¹« ´ÊÀ» ¼ö ÀÖÀ½. |
|---|
| 195 | // todo.. |
|---|
| 196 | |
|---|
| 197 | #if SUPPORT_MICOM |
|---|
| 198 | // no channel guide check |
|---|
| 199 | DMG_SetUserDefined(UD_ID_NO_CH_GUIDE, 0, 0); |
|---|
| 200 | |
|---|
| 201 | // ÃÖÃÊ Ã¤³Î ´Ù½Ã Æ©´×.. |
|---|
| 202 | // inband¿Í si ´Â ±¸ºÐÇØ¾ß ÇÔ. |
|---|
| 203 | if (App_Op_GetOperationState() == eAPP_OP_OOB_WAITING) |
|---|
| 204 | { |
|---|
| 205 | // oob_wait osd.. |
|---|
| 206 | // ÀÌ¹Ì oob wait msg°¡ ¶° ÀÖ´Ù°í °¡Á¤Çϸé.. ¾Æ¹« ÇÒ ÀÏ ¾øÀ½.. |
|---|
| 207 | } |
|---|
| 208 | else if (App_Op_GetOperationState() == eAPP_OP_OOB_ACTIVE) |
|---|
| 209 | { |
|---|
| 210 | // oob si¸¦ ÀÌ¿ëÇÏ¿© ä³Î Æ©´×.. |
|---|
| 211 | App_ChTuneRecoverLastChannel(); |
|---|
| 212 | } |
|---|
| 213 | else |
|---|
| 214 | { |
|---|
| 215 | App_ChTuneRecoverLastChannel(); |
|---|
| 216 | } |
|---|
| 217 | |
|---|
| 218 | #else |
|---|
| 219 | App_ChTuneRecoverLastChannel(); |
|---|
| 220 | #endif // #if SUPPORT_UDCP |
|---|
| 221 | |
|---|
| 222 | } |
|---|
| 223 | else { |
|---|
| 224 | dprint(0, "!! invalid power state %d\n", state); |
|---|
| 225 | return; |
|---|
| 226 | } |
|---|
| 227 | |
|---|
| 228 | s_PowerState = state; |
|---|
| 229 | } |
|---|
| 230 | |
|---|
| 231 | |
|---|
| 232 | /* |
|---|
| 233 | ÇöÀçÀÇ Power State »óŸ¦ µ¹·ÁÁØ´Ù. |
|---|
| 234 | */ |
|---|
| 235 | APP_POWER_STATE App_Pwr_GetPowerState(void) |
|---|
| 236 | { |
|---|
| 237 | return s_PowerState; |
|---|
| 238 | } |
|---|
| 239 | |
|---|
| 240 | |
|---|
| 241 | /* |
|---|
| 242 | Standby »óÅ¿¡¼ Normal »óÅ·ΠReady°¡ µÈ ÀÌÈÄ¿¡ ºÒ¸®´Â ÇÔ¼ö. |
|---|
| 243 | ÀÌ ÇÔ¼ö¸¦ menu task°¡ ¾Æ´Ñ °÷¿¡¼ Á÷Á¢ ºÎ¸£Áö ¾Êµµ·Ï ÇÑ´Ù. |
|---|
| 244 | Ç×»ó menu task¸¦ ÅëÇØ¼ ºÎ¸£µµ·Ï ÇÏÀÚ. |
|---|
| 245 | */ |
|---|
| 246 | void App_Pwr_Ready(void) |
|---|
| 247 | { |
|---|
| 248 | // Ãʱ⠻óŰ¡ full power »óÅÂÀ̾î¾ß ÇÏ´ÂÁö, standby »óÅÂÀ̾î¾ß ÇÏ´ÂÁö´Â |
|---|
| 249 | // product ¸¶´Ù ´Ù¸¦ ¼ö ÀÖÀ½. |
|---|
| 250 | // |
|---|
| 251 | // MICOMÀ» »ç¿ëÇÏ´Â ´ëºÎºÐÀÇ platform µé, ¶Ç´Â Cable product µéÀº Main Host´Â |
|---|
| 252 | // Ç×»ó full power mode¸¸ Á¦°øÇÑ´Ù. |
|---|
| 253 | |
|---|
| 254 | dprint(2, "\n-------------------------------\n"); |
|---|
| 255 | dprint(2, " power on ready. start with %s state..\n", APP_POWER_STATE_STR(DEFAULT_POWER_STATE)); |
|---|
| 256 | |
|---|
| 257 | // DHL ¾ÈÀ¸·Î Áý¾î ³Ö´Â °ÍÀÌ ³´Áö ¾Ê´Â°¡? |
|---|
| 258 | //#include "DHL_IO.h" |
|---|
| 259 | DHL_UART_TransComm(eDHL_UART_CMD_SetReadyToStart, NULL, 0); |
|---|
| 260 | |
|---|
| 261 | // ¼ø¼°¡ Áß¿äÇÏ´Ù. ¾îÂ¥ÇÇ µÎ¹ø Æ©´×ÀÌ µÉ ¼ö ¹Û¿¡ ¾øÀ¸¹Ç·Î, |
|---|
| 262 | // power init »óÅ¿¡¼ ¸ÕÀú card¸¦ üũÇϰí (À̶§ ȸé Ãâ·ÂÀº disable µÇ¾î ÀÖÀ½) |
|---|
| 263 | // ±× ´ÙÀ½¿¡ power state change¸¦ ÇÑ´Ù. |
|---|
| 264 | |
|---|
| 265 | bFirstboot = TRUE; |
|---|
| 266 | /* 2010.04.06 foxhunt |
|---|
| 267 | * ºÎÆÃ ÈÄ Operation State ¼³Á¤ÀÌ ³¡³¯ ¶§±îÁö, ºÎÆÃÀÌ ÁøÇà ÁßÀÓÀ» ¼³Á¤ÇÏ´Â º¯¼ö */ |
|---|
| 268 | |
|---|
| 269 | #if SUPPORT_MICOM |
|---|
| 270 | App_Op_CheckOperationState(); |
|---|
| 271 | #endif |
|---|
| 272 | |
|---|
| 273 | App_Pwr_ChangePowerState(DEFAULT_POWER_STATE); |
|---|
| 274 | } |
|---|
| 275 | |
|---|
| 276 | |
|---|
| 277 | |
|---|
| 278 | |
|---|
| 279 | |
|---|
| 280 | #if COMMENT |
|---|
| 281 | ____Operation_State____(){} |
|---|
| 282 | #endif |
|---|
| 283 | |
|---|
| 284 | #if SUPPORT_POD |
|---|
| 285 | /* |
|---|
| 286 | ÀÌ ÇÔ¼ö´Â ¹Ýµå½Ã menu task ¿¡¼ ºÒ·ÁÁ®¾ß ÇÔ. |
|---|
| 287 | menu task°¡ ¾Æ´Ï¸é assertion Ãß°¡ (°³¹ß¿ë) |
|---|
| 288 | */ |
|---|
| 289 | void App_Op_CheckOperationState(void) |
|---|
| 290 | { |
|---|
| 291 | APP_OP_STATE new_state, cur_state = App_Op_GetOperationState(); |
|---|
| 292 | |
|---|
| 293 | // card on/off ¿©ºÎ |
|---|
| 294 | BOOL bCardIn, bSiActive, bOobChannelReady; |
|---|
| 295 | DHL_RESULT dhr; |
|---|
| 296 | |
|---|
| 297 | dhr = PODIF_Status(ePODIF_STATUS_CARDIN, &bCardIn); |
|---|
| 298 | if (dhr) return; |
|---|
| 299 | |
|---|
| 300 | // oob si ¼ö½Å ¿©ºÎ |
|---|
| 301 | DmcSiScanStatus stat; |
|---|
| 302 | Dmc_ScteSiGetStatus(&stat); |
|---|
| 303 | |
|---|
| 304 | if (stat.raw_section_count>0) |
|---|
| 305 | bSiActive = TRUE; |
|---|
| 306 | else |
|---|
| 307 | bSiActive = FALSE; |
|---|
| 308 | |
|---|
| 309 | // oob ch db ¿©ºÎ.. |
|---|
| 310 | // todo.. À̰ÍÀÌ Ç×»ó oob channel À̶ó´Â °ÍÀÎÁö ¾î¶»°Ô º¸ÀåµÇ´Â°¡? |
|---|
| 311 | bOobChannelReady = APP_ScteSiChListUpdateCount()>0 ? TRUE : FALSE; |
|---|
| 312 | |
|---|
| 313 | new_state = |
|---|
| 314 | !bCardIn ? eAPP_OP_CABLE_INB : |
|---|
| 315 | !bSiActive ? eAPP_OP_CARD_INB : |
|---|
| 316 | !bOobChannelReady ? eAPP_OP_OOB_WAITING : eAPP_OP_OOB_ACTIVE; |
|---|
| 317 | |
|---|
| 318 | if (cur_state == new_state) |
|---|
| 319 | dprint(0, "!! same Operation state !!\n"); |
|---|
| 320 | |
|---|
| 321 | if (cur_state != new_state) |
|---|
| 322 | { |
|---|
| 323 | App_Op_ChangeOperationState(new_state); |
|---|
| 324 | } |
|---|
| 325 | } |
|---|
| 326 | |
|---|
| 327 | |
|---|
| 328 | /* |
|---|
| 329 | ÀÌ ÇÔ¼ö´Â ¹Ýµå½Ã menu task ¿¡¼ ºÒ·ÁÁ®¾ß ÇÔ. |
|---|
| 330 | menu task°¡ ¾Æ´Ï¸é assertion Ãß°¡ (°³¹ß¿ë) |
|---|
| 331 | */ |
|---|
| 332 | void App_Op_ChangeOperationState(APP_OP_STATE state) |
|---|
| 333 | { |
|---|
| 334 | int i; |
|---|
| 335 | |
|---|
| 336 | if ((UINT32)state >= eAPP_OP_MAX) { |
|---|
| 337 | dprint(0, "!! try changing to wrong operation state %d\n", state); |
|---|
| 338 | return; |
|---|
| 339 | } |
|---|
| 340 | if (state == s_OperationState) { |
|---|
| 341 | dprint(0, "!! same Operation state\n"); |
|---|
| 342 | return; |
|---|
| 343 | } |
|---|
| 344 | APP_OP_STATE prev = s_OperationState; |
|---|
| 345 | |
|---|
| 346 | dprint(0, "OperationStateChange: %s (%d) --> %s (%d)\n", |
|---|
| 347 | APP_OP_STATE_STR(prev), prev, APP_OP_STATE_STR(state), state); |
|---|
| 348 | |
|---|
| 349 | |
|---|
| 350 | if (state == eAPP_OP_CABLE_INB) |
|---|
| 351 | { |
|---|
| 352 | // ÀÏ¹Ý ¼ýÀÚŰ ÀԷ½à ä³Î¸Ê¿¡ ÀÖ´Â Á¤º¸¸¦ ÀÌ¿ëÇØ¼¸¸ Æ©´× |
|---|
| 353 | dprint(0, "Entering Cable Inband mode...\n"); |
|---|
| 354 | |
|---|
| 355 | App_ChTuneStopTV(); |
|---|
| 356 | |
|---|
| 357 | // ARZHNA, 100217 |
|---|
| 358 | APP_POD_SetTsRoute(FALSE); |
|---|
| 359 | |
|---|
| 360 | // stop for all tuner threads |
|---|
| 361 | for (i=0; i<FE_CFG_NUM_TUNER; i++) |
|---|
| 362 | DHL_FE_Stop(i); |
|---|
| 363 | |
|---|
| 364 | // OOB SI ¼ö½Å ÁßÁö. ¸ðµç SI DB Á¦°Å. |
|---|
| 365 | /* |
|---|
| 366 | SI µ¥ÀÌÅ͸¦ ¸ðµÎ clearÇÏÁö ¾ÊÀ¸¸é ´ÙÀ½¿¡ card¸¦ ²ÅÀº ÈÄ¿¡ |
|---|
| 367 | Channel DB°¡ Á¦´ë·Î ¸¸µé¾îÁöÁö ¾Ê´Â ¹®Á¦°¡ »ý±è. |
|---|
| 368 | ±×·¡¼ ¹Ýµå½Ã tableµéÀ» ¸ðµÎ free ÇÏ´Â ÀÛ¾÷±îÁö ¼öÇàµÇ¾î¾ß ÇÔ. |
|---|
| 369 | */ |
|---|
| 370 | APP_ScteSiStop(); |
|---|
| 371 | |
|---|
| 372 | // host mmiÀÇ appÁ¤º¸ µî·Ï FALSE. ÇÔ¼ö ÂüÁ¶¹Ù¶÷. |
|---|
| 373 | AppInfoRegisterOn(FALSE); |
|---|
| 374 | |
|---|
| 375 | // card out popup : Ä«µå°¡ °©Àڱ⠻ÌÈ÷´Â °æ¿ì¸¦ À§ÇØ Á¾·á ¶§ÀÇ µ¿ÀÛÀ» ¸ðµÎ ÇØÁØ´Ù. |
|---|
| 376 | // ¾Õ¿¡ ÀÖ´Â ¸Þ´ººÎÅÍ Áö¿ì¸é, Áö¿ï ¶§ ±× µÚ¿¡ ÀÖ´Â ¸Þ´º°¡ Àá±ñ º¸¿©Áö°Ô µÇ¹Ç·Î, |
|---|
| 377 | // ¸Ç µÚ¿¡ ÀÖ´Â ¸Þ´ººÎÅÍ Áö¿î´Ù. |
|---|
| 378 | // 2010.03.24 foxhunt : cafrii opinion¿¡ µû¸¥ Àç¹èÄ¡ |
|---|
| 379 | DMG_MenuExit(MID_SI_STATE); // oob waiting mode¿¡¼ °©ÀÚ±â Ä«µå »ÌÈú °æ¿ì exit |
|---|
| 380 | HTML_Exit(); |
|---|
| 381 | APP_POD_CloseDialog(); // host or card·ÎºÎÅÍÀÇ dialog close |
|---|
| 382 | DMG_MenuExit(MID_HTML_MMI_CARD); |
|---|
| 383 | DMG_MenuExit(MID_HTML_MMI); |
|---|
| 384 | DMG_MenuExit(MID_HTML_LIST); |
|---|
| 385 | DMG_MenuStart(MID_CARD_ON); |
|---|
| 386 | |
|---|
| 387 | // ÀÌÀü ä³Î Æ©´×.. |
|---|
| 388 | App_NVM_LoadUcm(); |
|---|
| 389 | |
|---|
| 390 | /* 2010.03.19 foxhunt |
|---|
| 391 | * power state¸¦ üũÇÒ °æ¿ì, no channel guide°¡ º¸ÀÌÁö ¾Ê°Ô µÈ´Ù.(¾Æ¿¹ µ¿ÀÛ ¾ÈÇÔ) |
|---|
| 392 | * operation stateº¸´Ù power stateÀÇ ½ÃÀÛÀÌ ´À¸° °ÍÀ¸·Î º¸ÀÓ. |
|---|
| 393 | * eAPP_PS_NORMALÀÌ ¾Æ´Ñ °æ¿ì¿¡µµ º¸ÀÌ°Ô µÈ´Ù¸é, ÁÖ¼®À» Ç®µÇ App_Pwr_Ready¿¡¼ ¼ø¼¸¦ º¯°æÇØ¾ß ÇÑ´Ù. |
|---|
| 394 | */ |
|---|
| 395 | //if(App_Pwr_GetPowerState() == eAPP_PS_NORMAL) |
|---|
| 396 | if(1) |
|---|
| 397 | { |
|---|
| 398 | // no channel guide check |
|---|
| 399 | DMG_SetUserDefined(UD_ID_NO_CH_GUIDE, 0, 0); |
|---|
| 400 | |
|---|
| 401 | dprint(1, "recover last channel..\n"); |
|---|
| 402 | App_ChTuneRecoverLastChannel(); |
|---|
| 403 | } |
|---|
| 404 | } |
|---|
| 405 | else if (state == eAPP_OP_CARD_INB) |
|---|
| 406 | { |
|---|
| 407 | // Card°¡ ÀåÂøµÇ¾úÀ¸³ª ¾ÆÁ÷ OOB½ÅÈ£°¡ lockÀÌ ¾ÈµÈ »óÅ |
|---|
| 408 | dprint(0, "Entering Card Inband mode...\n"); |
|---|
| 409 | |
|---|
| 410 | if (prev != eAPP_OP_CABLE_INB) |
|---|
| 411 | APP_ScteSiStop(); |
|---|
| 412 | |
|---|
| 413 | // ARZHNA, 100217 |
|---|
| 414 | APP_POD_SetTsRoute(TRUE); |
|---|
| 415 | |
|---|
| 416 | // OOB SI ¼ö½Å ½ÃÀÛ.. |
|---|
| 417 | APP_ScteSiStart(); |
|---|
| 418 | |
|---|
| 419 | // card in popup |
|---|
| 420 | if(!bFirstboot) // ºÎÆÃ½Ã Ä«µå°¡ »ðÀԵǾîÀÖÀ» ¶§¿¡´Â MID_CARD_ONÀ» ½ÃÀÛÇÏÁö ¾Ê´Â´Ù. |
|---|
| 421 | DMG_MenuStart(MID_CARD_ON); |
|---|
| 422 | |
|---|
| 423 | // no channel guide check |
|---|
| 424 | DMG_SetUserDefined(UD_ID_NO_CH_GUIDE, 0, 0); |
|---|
| 425 | } |
|---|
| 426 | else if (state == eAPP_OP_OOB_WAITING) |
|---|
| 427 | { |
|---|
| 428 | // OOB SI µ¥ÀÌÅͰ¡ ¼ö½ÅµÇ°í ÀÖ´Â »óÅ |
|---|
| 429 | dprint(0, "Entering OOB Waiting mode...\n"); |
|---|
| 430 | |
|---|
| 431 | // 2010.03.17 foxhunt : oob mode¿¡¼´Â no channel guide°¡ ÇÊ¿ä¾øÀ¸¹Ç·Î Áö¿ò. |
|---|
| 432 | // DMG_MenuExit(MID_NO_CH_GUIDE); |
|---|
| 433 | |
|---|
| 434 | /* TO DO : DRF, RF scan ±â´É disable */ |
|---|
| 435 | |
|---|
| 436 | // card in popup |
|---|
| 437 | DMG_MenuExit(MID_CARD_ON); |
|---|
| 438 | |
|---|
| 439 | // si data ¼ö½Å Áß popup |
|---|
| 440 | DMG_MenuStart(MID_SI_STATE); |
|---|
| 441 | |
|---|
| 442 | // ¸¶Áö¸· ½Ãû ä³ÎÀ» ±â¾ïÇØ ³õ¾Æ¾ß ÇÔ. |
|---|
| 443 | // todo.. |
|---|
| 444 | |
|---|
| 445 | // ¹Ù·Î ÀÌ ½ÃÁ¡¿¡¼ TV stop.. |
|---|
| 446 | App_ChTuneStopTV(); |
|---|
| 447 | App_EpgDeleteAll(); |
|---|
| 448 | |
|---|
| 449 | /* |
|---|
| 450 | ¾Æ·¡ ÄÚµå´Â Á¤È®È÷ ¸»Çϸé UDCPÀ» À§ÇÑ Äڵ尡 ¾Æ´Ï¶ó b3114 µ¿ÀÛÀ» À§ÇØ ÇÊ¿äÇÑ ÄÚµåÀÓ. |
|---|
| 451 | b3114´Â firmware ¾øÀÌ µ¿ÀÛÇϹǷΠº°µµÀÇ tuner control thread¸¦ »ç¿ëÇÑ´Ù. |
|---|
| 452 | DHL_FE_Stop À¸·Î thread°¡ stop µÇµµ·Ï ÀÛ¼ºÇØ ³õ¾Ò´Ù. |
|---|
| 453 | |
|---|
| 454 | thread°¡ °è¼Ó µ¿ÀÛÇÑ´Ù°í ÇØ¼ Å©°Ô ¹®Á¦µÉ °ÍÀº ¾øÀ¸³ª |
|---|
| 455 | threadÀÇ ÀÀ´ä¼ºÀÌ ¶³¾îÁú ¼ö Àֱ⠶§¹®¿¡ stop ÇØÁØ´Ù. |
|---|
| 456 | ¿¹¸¦ µé¸é Card°¡ ¾ø´Â °æ¿ì thread´Â Inband tuning¸¸ ÇÏ¸é µÇ´Âµ¥ |
|---|
| 457 | ÀÌÀü¿¡ Æ©´× µÇ¾ú´ø oob status monitoring±îÁö °è¼Ó ÇÏ°Ô ³öµÑ °æ¿ì |
|---|
| 458 | thread°¡ ÇÒ ÀÏÀÌ ¸¹¾ÆÁ®¼ Inband Æ©´×¿¡ ¿µÇâÀ» ÁÙ ¼öµµ ÀÖ´Ù. |
|---|
| 459 | |
|---|
| 460 | DHL_FE_Start °°Àº API°¡ ´Ù½Ã »ç¿ëµÇ¸é ÇÊ¿äÇÑ modulation¿¡ ´ëÇØ¼ thread°¡ ´Ù½Ã µ¿ÀÛÇÑ´Ù. |
|---|
| 461 | |
|---|
| 462 | stopÀ» Á÷Á¢ µû·Î È£ÃâÇØ ÁÖ´Â ÀÌÀ¯´Â APP/MW ÀÇ ChStop ¸¸À¸·Î´Â DHL_FE_StopÀÌ È£ÃâÀÌ ¾ÈµÇ±â ¶§¹®. |
|---|
| 463 | ¿ø·¡ DHL_FE_Stop ÇÔ¼öÀÇ Àǹ̰¡ ¸íÈ®ÇÏÁö ¾Ê¾ÒÀ½. |
|---|
| 464 | (API ¹®¼¿¡´Â power control ¿ëµµ·Î¸¸ ¸í½ÃµÇ¾î ÀÖÀ½) |
|---|
| 465 | */ |
|---|
| 466 | for (i=0; i<FE_CFG_NUM_TUNER; i++) |
|---|
| 467 | DHL_FE_Stop(i); |
|---|
| 468 | |
|---|
| 469 | // DB »èÁ¦.. |
|---|
| 470 | DMW_CDB_ClearAll(); |
|---|
| 471 | |
|---|
| 472 | } |
|---|
| 473 | else if (state == eAPP_OP_OOB_ACTIVE) |
|---|
| 474 | { |
|---|
| 475 | // OOB CH mapÀÌ ¿Ï¼ºµÈ »óÅ |
|---|
| 476 | dprint(0, "Entering OOB Active mode...\n"); |
|---|
| 477 | |
|---|
| 478 | // OOB CH map ¿Ï¼º banner |
|---|
| 479 | DMG_SetUserDefined(UD_ID_SISTATE_BANNER, 0, 0); |
|---|
| 480 | |
|---|
| 481 | /* ÀÚµ¿ Æ©´× */ |
|---|
| 482 | App_ChTuneRecoverLastChannel(); |
|---|
| 483 | } |
|---|
| 484 | else |
|---|
| 485 | { |
|---|
| 486 | dprint(0, "!! invalid operation state %d\n", state); |
|---|
| 487 | return; |
|---|
| 488 | } |
|---|
| 489 | |
|---|
| 490 | if(bFirstboot) // ºÎÆÃ½Ã óÀ½ ¼³Á¤µÈ TRUE°ªÀÌ ¿Ã ¶§¸¸, FALSE·Î º¯°æÇØÁÖÀÚ. |
|---|
| 491 | bFirstboot = FALSE; |
|---|
| 492 | |
|---|
| 493 | s_OperationState = state; |
|---|
| 494 | } |
|---|
| 495 | |
|---|
| 496 | |
|---|
| 497 | APP_OP_STATE App_Op_GetOperationState(void) |
|---|
| 498 | { |
|---|
| 499 | return s_OperationState; |
|---|
| 500 | } |
|---|
| 501 | |
|---|
| 502 | #endif // #if SUPPORT_POD |
|---|
| 503 | |
|---|
| 504 | |
|---|
| 505 | |
|---|
| 506 | |
|---|
| 507 | |
|---|
| 508 | #if COMMENT |
|---|
| 509 | ____Group3____(){} |
|---|
| 510 | #endif |
|---|
| 511 | |
|---|
| 512 | /* backward compatibility */ |
|---|
| 513 | |
|---|
| 514 | /* |
|---|
| 515 | ´ÙÀ½ÀÇ °æ¿ì¿¡ È£ÃâµÈ´Ù. |
|---|
| 516 | [power] rcu button |
|---|
| 517 | sleep timer expire |
|---|
| 518 | no signal power down timer expire |
|---|
| 519 | no key input timer expire |
|---|
| 520 | */ |
|---|
| 521 | void App_Pwr_Exit(void) |
|---|
| 522 | { |
|---|
| 523 | App_NVM_Sync(); |
|---|
| 524 | DMW_CDB_WaitForNvRamSyncDone(); |
|---|
| 525 | |
|---|
| 526 | // ÀÏ´Ü ¹«Á¶°Ç Active Standby ·Î ÁøÀÔÇÏ°Ô ÇÔ. |
|---|
| 527 | // Active Standby ¸¦ Áö¿øÇÏÁö ¾Ê´Â platform À̶ó¸é ´ç¿¬È÷ Deep Standby¸¦ ÀǹÌÇÏ°Ô µÊ. |
|---|
| 528 | App_Pwr_ChangePowerState(eAPP_PS_ACTIVE_STANDBY); |
|---|
| 529 | } |
|---|
| 530 | |
|---|
| 531 | |
|---|
| 532 | void App_Pwr_Reset() |
|---|
| 533 | { |
|---|
| 534 | // |
|---|
| 535 | // |
|---|
| 536 | } |
|---|
| 537 | |
|---|
| 538 | |
|---|
| 539 | |
|---|
| 540 | |
|---|
| 541 | #if COMMENT |
|---|
| 542 | ____Debug____(){} |
|---|
| 543 | #endif |
|---|
| 544 | |
|---|
| 545 | |
|---|
| 546 | |
|---|
| 547 | #if COMMENT |
|---|
| 548 | ____Init____(){} |
|---|
| 549 | #endif |
|---|
| 550 | |
|---|
| 551 | /* |
|---|
| 552 | App module ÃʱâÈ ÄÚµå. |
|---|
| 553 | |
|---|
| 554 | ÀÌ ½ÃÁ¡¿¡¼´Â OSD, AV decoder, display µîÀÇ ÃʱâÈ »óŸ¦ Àå´ãÇÒ ¼ö ¾øÀ¸¹Ç·Î |
|---|
| 555 | ÀÌ ÇÔ¼ö ³»¿¡¼ Power State Change¸¦ ½Ãµµ ÇÏ¸é ¾È µÈ´Ù. |
|---|
| 556 | |
|---|
| 557 | NVM Àº Á¢±Ù °¡´ÉÇÏ´Ù. Á¤Àü º¸»ó ±â´É µîÀÌ ÇÊ¿äÇÒ °æ¿ì nvm i/o ÀÛ¾÷ÀÌ ÇÊ¿äÇÔ. |
|---|
| 558 | */ |
|---|
| 559 | void App_Pwr_Init(void) |
|---|
| 560 | { |
|---|
| 561 | RegisterSymbols(); |
|---|
| 562 | |
|---|
| 563 | /* °¢Á¾ init code.. */ |
|---|
| 564 | //DHL_AV_AudioSetUserVolumeRange(0, eAPP_AUDIO_VOLUME_MAX); |
|---|
| 565 | |
|---|
| 566 | /* load nv param */ |
|---|
| 567 | //App_Audio_LoadNvParam(); |
|---|
| 568 | |
|---|
| 569 | /* apply nv param */ |
|---|
| 570 | //DHL_AV_AudioSetVolume(s_nvparam.volume); |
|---|
| 571 | } |
|---|
| 572 | |
|---|
| 573 | |
|---|
| 574 | #endif /* SUPPORT_POWEROFF */ |
|---|
| 575 | |
|---|
| 576 | |
|---|
| 577 | /* end of file */ |
|---|