show_animation_common.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. /* Copyright Statement:
  2. *
  3. * This software/firmware and related documentation ("MediaTek Software") are
  4. * protected under relevant copyright laws. The information contained herein is
  5. * confidential and proprietary to MediaTek Inc. and/or its licensors. Without
  6. * the prior written permission of MediaTek inc. and/or its licensors, any
  7. * reproduction, modification, use or disclosure of MediaTek Software, and
  8. * information contained herein, in whole or in part, shall be strictly
  9. * prohibited.
  10. *
  11. * MediaTek Inc. (C) 2010. All rights reserved.
  12. *
  13. * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  14. * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  15. * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
  16. * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
  17. * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
  19. * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
  20. * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
  21. * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
  22. * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
  23. * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
  24. * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
  25. * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
  26. * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
  27. * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
  28. * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
  29. * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
  30. * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
  31. * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
  32. *
  33. * The following software/firmware and/or related documentation ("MediaTek
  34. * Software") have been modified by MediaTek Inc. All revisions are subject to
  35. * any receiver's applicable license agreements with MediaTek Inc.
  36. */
  37. #include <stdio.h>
  38. #include <stdlib.h>
  39. #include <string.h>
  40. #include "show_animation_common.h"
  41. #include "show_logo_log.h"
  42. static int charging_low_index = 0;
  43. static int charging_animation_index = 0;
  44. static int version0_charging_index = 0;
  45. static int bits = 0;
  46. static int is_logo = 1;
  47. #define CHECK_LOGO_BIN_OK 0
  48. #define CHECK_LOGO_BIN_ERROR -1
  49. static unsigned short number_pic_addr[(NUMBER_RIGHT - NUMBER_LEFT)*(NUMBER_BOTTOM - NUMBER_TOP)*4] = {0x0}; //addr
  50. static unsigned short line_pic_addr[(TOP_ANIMATION_RIGHT - TOP_ANIMATION_LEFT)*4] = {0x0};
  51. static unsigned short percent_pic_addr[(PERCENT_RIGHT - PERCENT_LEFT)*(PERCENT_BOTTOM - PERCENT_TOP)*4] = {0x0};
  52. static unsigned short top_animation_addr[(TOP_ANIMATION_RIGHT - TOP_ANIMATION_LEFT)*(TOP_ANIMATION_BOTTOM - TOP_ANIMATION_TOP)*4] = {0x0};
  53. /*
  54. * Check whether logo.bin is loaded or not. Avoid error in META mode
  55. * enable : logo.bin needs to be loaded or not
  56. */
  57. void enable_logo(bool enable)
  58. {
  59. is_logo = enable;
  60. }
  61. /*
  62. * Check logo.bin address if valid, and get logo related info
  63. *
  64. */
  65. int check_logo_index_valid(unsigned int index, void * logo_addr, LOGO_PARA_T * logo_info)
  66. {
  67. if (!is_logo) {
  68. return CHECK_LOGO_BIN_ERROR;
  69. }
  70. unsigned int *pinfo = (unsigned int*)logo_addr;
  71. logo_info->logonum = pinfo[0];
  72. LOG_ANIM("[show_animation_common: %s %d]logonum =%d, index =%d\n", __FUNCTION__,__LINE__,logo_info->logonum, index);
  73. if (index >= logo_info->logonum)
  74. {
  75. LOG_ANIM("[show_animation_common: %s %d]unsupported logo, index =%d\n", __FUNCTION__,__LINE__, index);
  76. return CHECK_LOGO_BIN_ERROR;
  77. }
  78. // LOG_ANIM("show_animation_common, pinfo[1]=%d, pinfo[2+index]=%d, pinfo[3+index]=%d, pinfo[3+index] - pinfo[2+index]= %d, pinfo[1] - pinfo[2+index] =%d \n",
  79. // pinfo[1],pinfo[2+index],pinfo[3+index], pinfo[3+index] - pinfo[2+index],pinfo[1] - pinfo[2+index]);
  80. if(index < logo_info->logonum - 1)
  81. logo_info->logolen = pinfo[3+index] - pinfo[2+index];
  82. else
  83. logo_info->logolen = pinfo[1] - pinfo[2+index];
  84. logo_info->inaddr = (unsigned int)logo_addr + pinfo[2+index];
  85. LOG_ANIM("show_animation_common, in_addr=0x%08x, logolen=%d\n",
  86. logo_info->inaddr, logo_info->logolen);
  87. return CHECK_LOGO_BIN_OK;
  88. }
  89. /*
  90. * Fill a screen size buffer with logo content
  91. *
  92. */
  93. void fill_animation_logo(unsigned int index, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen)
  94. {
  95. LOGO_PARA_T logo_info;
  96. int logo_width;
  97. int logo_height;
  98. int raw_data_size;
  99. if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK)
  100. return;
  101. raw_data_size = decompress_logo((void*)logo_info.inaddr, dec_logo_addr, logo_info.logolen, phical_screen.fb_size);
  102. //RECT_REGION_T rect = {0, 0, phical_screen.width, phical_screen.height};
  103. logo_width =phical_screen.width;
  104. logo_height = phical_screen.height;
  105. if (phical_screen.rotation == 270 || phical_screen.rotation == 90) {
  106. logo_width =phical_screen.height;
  107. logo_height = phical_screen.width;
  108. }
  109. if (0 == bits) {
  110. if (raw_data_size == logo_width*logo_height*4) {
  111. bits = 32;
  112. } else if (raw_data_size == logo_width*logo_height*2) {
  113. bits = 16;
  114. } else {
  115. LOG_ANIM("[show_animation_common: %s %d]Logo data error\n",__FUNCTION__,__LINE__);
  116. return;
  117. }
  118. LOG_ANIM("[show_animation_common: %s %d]bits = %d\n",__FUNCTION__,__LINE__, bits);
  119. }
  120. RECT_REGION_T rect = {0, 0, logo_width, logo_height};
  121. fill_rect_with_content(fill_addr, rect, dec_logo_addr, phical_screen, bits);
  122. }
  123. /*
  124. * Fill a rectangle size address with special color
  125. *
  126. */
  127. void fill_animation_prog_bar(RECT_REGION_T rect_bar,
  128. unsigned int fgColor,
  129. unsigned int start_div, unsigned int occupied_div,
  130. void *fill_addr, LCM_SCREEN_T phical_screen)
  131. {
  132. unsigned int div_size = (rect_bar.bottom - rect_bar.top) / (ANIM_V0_REGIONS);
  133. unsigned int draw_size = div_size - (ANIM_V0_SPACE_AFTER_REGION);
  134. unsigned int i;
  135. for (i = start_div; i < start_div + occupied_div; ++ i)
  136. {
  137. unsigned int draw_bottom = rect_bar.bottom - div_size * i - (ANIM_V0_SPACE_AFTER_REGION);
  138. unsigned int draw_top = draw_bottom - draw_size;
  139. RECT_REGION_T rect = {rect_bar.left, draw_top, rect_bar.right, draw_bottom};
  140. fill_rect_with_color(fill_addr, rect, fgColor, phical_screen);
  141. }
  142. }
  143. /*
  144. * Fill a rectangle with logo content
  145. *
  146. */
  147. void fill_animation_dynamic(unsigned int index, RECT_REGION_T rect, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen)
  148. {
  149. LOGO_PARA_T logo_info;
  150. int raw_data_size;
  151. if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK)
  152. return;
  153. raw_data_size = decompress_logo((void*)logo_info.inaddr, (void*)dec_logo_addr, logo_info.logolen, (rect.right-rect.left)*(rect.bottom-rect.top)*4);
  154. if (0 == bits) {
  155. if (raw_data_size == (rect.right-rect.left)*(rect.bottom-rect.top)*4) {
  156. bits = 32;
  157. } else if (raw_data_size == (rect.right-rect.left)*(rect.bottom-rect.top)*2) {
  158. bits = 16;
  159. } else {
  160. LOG_ANIM("[show_animation_common: %s %d]Logo data error\n",__FUNCTION__,__LINE__);
  161. return;
  162. }
  163. LOG_ANIM("[show_animation_common: %s %d]bits = %d\n",__FUNCTION__,__LINE__, bits);
  164. }
  165. fill_rect_with_content(fill_addr, rect, dec_logo_addr, phical_screen, bits);
  166. }
  167. /*
  168. * Fill a rectangle with number logo content
  169. *
  170. * number_position: 0~1st number, 1~2nd number
  171. */
  172. void fill_animation_number(unsigned int index, unsigned int number_position, void *fill_addr, void * logo_addr, LCM_SCREEN_T phical_screen)
  173. {
  174. LOG_ANIM("[show_animation_common: %s %d]index= %d, number_position = %d\n",__FUNCTION__,__LINE__, index, number_position);
  175. LOGO_PARA_T logo_info;
  176. int raw_data_size;
  177. if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK)
  178. return;
  179. // draw default number rect,
  180. raw_data_size = decompress_logo((void*)logo_info.inaddr, (void*)number_pic_addr, logo_info.logolen, number_pic_size);
  181. //static RECT_REGION_T number_location_rect = {NUMBER_LEFT,NUMBER_TOP,NUMBER_RIGHT,NUMBER_BOTTOM};
  182. RECT_REGION_T battery_number_rect = {NUMBER_LEFT + (NUMBER_RIGHT - NUMBER_LEFT)*number_position,
  183. NUMBER_TOP,
  184. NUMBER_RIGHT + (NUMBER_RIGHT - NUMBER_LEFT)*number_position,
  185. NUMBER_BOTTOM};
  186. if (0 == bits) {
  187. if (raw_data_size == (NUMBER_RIGHT - NUMBER_LEFT)*(NUMBER_BOTTOM - NUMBER_TOP)*4) {
  188. bits = 32;
  189. } else if (raw_data_size == (NUMBER_RIGHT - NUMBER_LEFT)*(NUMBER_BOTTOM - NUMBER_TOP)*2) {
  190. bits = 16;
  191. } else {
  192. LOG_ANIM("[show_animation_common: %s %d]Logo data error\n",__FUNCTION__,__LINE__);
  193. return;
  194. }
  195. LOG_ANIM("[show_animation_common: %s %d]bits = %d\n",__FUNCTION__,__LINE__, bits);
  196. }
  197. fill_rect_with_content(fill_addr, battery_number_rect, number_pic_addr,phical_screen, bits);
  198. }
  199. /*
  200. * Fill a line with special color
  201. *
  202. */
  203. void fill_animation_line(unsigned int index, unsigned int capacity_grids, void *fill_addr, void * logo_addr, LCM_SCREEN_T phical_screen)
  204. {
  205. LOGO_PARA_T logo_info;
  206. int raw_data_size;
  207. if(check_logo_index_valid(index, logo_addr, &logo_info) != CHECK_LOGO_BIN_OK)
  208. return;
  209. raw_data_size = decompress_logo((void*)logo_info.inaddr, (void*)line_pic_addr, logo_info.logolen, line_pic_size);
  210. if (0 == bits) {
  211. if (raw_data_size == (TOP_ANIMATION_RIGHT - TOP_ANIMATION_LEFT)*4) {
  212. bits = 32;
  213. } else if (raw_data_size == (TOP_ANIMATION_RIGHT - TOP_ANIMATION_LEFT)*2) {
  214. bits = 16;
  215. } else {
  216. LOG_ANIM("[show_animation_common: %s %d]Logo data error\n",__FUNCTION__,__LINE__);
  217. return;
  218. }
  219. LOG_ANIM("[show_animation_common: %s %d]bits = %d\n",__FUNCTION__,__LINE__, bits);
  220. }
  221. RECT_REGION_T rect = {CAPACITY_LEFT, CAPACITY_TOP, CAPACITY_RIGHT, CAPACITY_BOTTOM};
  222. int i = capacity_grids;
  223. for(; i < CAPACITY_BOTTOM; i++)
  224. {
  225. rect.top = i;
  226. rect.bottom = i+1;
  227. fill_rect_with_content(fill_addr, rect, line_pic_addr, phical_screen, bits);
  228. }
  229. }
  230. /*
  231. * Show old charging animation
  232. *
  233. */
  234. void fill_animation_battery_old(unsigned int capacity, void *fill_addr, void * dec_logo_addr, void * logo_addr,
  235. LCM_SCREEN_T phical_screen)
  236. {
  237. int capacity_grids = 0;
  238. if (capacity > 100) capacity = 100;
  239. capacity_grids = (capacity * (ANIM_V0_REGIONS)) / 100;
  240. if (version0_charging_index < capacity_grids * 2)
  241. version0_charging_index = capacity_grids * 2;
  242. if (capacity < 100){
  243. version0_charging_index > 7? version0_charging_index = capacity_grids * 2 : version0_charging_index++;
  244. } else {
  245. version0_charging_index = ANIM_V0_REGIONS * 2;
  246. }
  247. fill_animation_logo(ANIM_V0_BACKGROUND_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen);
  248. RECT_REGION_T rect_bar = {bar_rect.left + 1, bar_rect.top + 1, bar_rect.right, bar_rect.bottom};
  249. fill_animation_prog_bar(rect_bar,
  250. (unsigned int)(BAR_OCCUPIED_COLOR),
  251. 0, version0_charging_index/2,
  252. fill_addr, phical_screen);
  253. fill_animation_prog_bar(rect_bar,
  254. (unsigned int)(BAR_EMPTY_COLOR),
  255. version0_charging_index/2, ANIM_V0_REGIONS - version0_charging_index/2,
  256. fill_addr, phical_screen);
  257. }
  258. /*
  259. * Show new charging animation
  260. *
  261. */
  262. void fill_animation_battery_new(unsigned int capacity, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen)
  263. {
  264. LOG_ANIM("[show_animation_common: %s %d]capacity : %d\n",__FUNCTION__,__LINE__, capacity);
  265. if (capacity >= 100) {
  266. //show_logo(37); // battery 100
  267. fill_animation_logo(FULL_BATTERY_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen);
  268. } else if (capacity < 10) {
  269. LOG_ANIM("[show_animation_common: %s %d]charging_low_index = %d\n",__FUNCTION__,__LINE__, charging_low_index);
  270. charging_low_index ++ ;
  271. fill_animation_logo(LOW_BAT_ANIM_START_0 + charging_low_index, fill_addr, dec_logo_addr, logo_addr,phical_screen);
  272. fill_animation_number(NUMBER_PIC_START_0 + capacity, 1, fill_addr, logo_addr, phical_screen);
  273. fill_animation_dynamic(NUMBER_PIC_PERCENT, percent_location_rect, fill_addr, percent_pic_addr, logo_addr, phical_screen);
  274. if (charging_low_index >= 9) charging_low_index = 0;
  275. } else {
  276. unsigned int capacity_grids = 0;
  277. //static RECT_REGION_T battery_rect = {CAPACITY_LEFT,CAPACITY_TOP,CAPACITY_RIGHT,CAPACITY_BOTTOM};
  278. capacity_grids = CAPACITY_BOTTOM - (CAPACITY_BOTTOM - CAPACITY_TOP) * (capacity - 10) / 90;
  279. LOG_ANIM("[show_animation_common: %s %d]capacity_grids : %d,charging_animation_index = %d\n",__FUNCTION__,__LINE__, capacity_grids,charging_animation_index);
  280. //background
  281. fill_animation_logo(ANIM_V1_BACKGROUND_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen);
  282. fill_animation_line(ANIM_LINE_INDEX, capacity_grids, fill_addr, logo_addr, phical_screen);
  283. fill_animation_number(NUMBER_PIC_START_0 + (capacity/10), 0, fill_addr, logo_addr, phical_screen);
  284. fill_animation_number(NUMBER_PIC_START_0 + (capacity%10), 1, fill_addr, logo_addr, phical_screen);
  285. fill_animation_dynamic(NUMBER_PIC_PERCENT, percent_location_rect, fill_addr, percent_pic_addr, logo_addr, phical_screen);
  286. if (capacity <= 90)
  287. {
  288. RECT_REGION_T top_animation_rect = {TOP_ANIMATION_LEFT, capacity_grids - (TOP_ANIMATION_BOTTOM - TOP_ANIMATION_TOP), TOP_ANIMATION_RIGHT, capacity_grids};
  289. //top_animation_rect.bottom = capacity_grids;
  290. //top_animation_rect.top = capacity_grids - top_animation_height;
  291. charging_animation_index++;
  292. //show_animation_dynamic(15 + charging_animation_index, top_animation_rect, top_animation_addr);
  293. fill_animation_dynamic(BAT_ANIM_START_0 + charging_animation_index, top_animation_rect, fill_addr, top_animation_addr, logo_addr, phical_screen);
  294. if (charging_animation_index >= 9) charging_animation_index = 0;
  295. }
  296. }
  297. }
  298. /*
  299. * Show wireless charging animation
  300. * total 29 logo:from 39 ~ 68
  301. * less(0<10): 50-53 , low(<30):54-57 ,middle(<60):58-61 , high():62-75 , o:66, full:67,num (0-9):39-48, %:49
  302. *
  303. */
  304. void fill_animation_battery_wireless_charging(unsigned int capacity, void *fill_addr, void * dec_logo_addr, void * logo_addr, LCM_SCREEN_T phical_screen)
  305. {
  306. LOG_ANIM("[show_animation_common: %s %d]capacity : %d\n",__FUNCTION__,__LINE__, capacity);
  307. // RECT_REGION_T wireless_bgd_rect = {0, 0, phical_screen.width, phical_screen.height};
  308. charging_low_index >= 3? charging_low_index = 0:charging_low_index++;
  309. LOG_ANIM("[show_animation_common: %s %d]charging_low_index = %d\n",__FUNCTION__,__LINE__, charging_low_index);
  310. if (capacity >= 100) {
  311. // battery 100
  312. fill_animation_logo(V2_BAT_100_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen);
  313. } else if (capacity <= 0) {
  314. fill_animation_logo(V2_BAT_0_INDEX, fill_addr, dec_logo_addr, logo_addr,phical_screen);
  315. } else {
  316. int bg_index = V2_BAT_0_10_START_INDEX; //capacity > 0 && capacity < 10
  317. if (capacity >= 10 && capacity < 40) {
  318. bg_index = V2_BAT_10_40_START_INDEX;
  319. } else if (capacity >= 40 && capacity < 80) {
  320. bg_index = V2_BAT_40_80_START_INDEX;
  321. } else if (capacity >= 80 && capacity < 100) {
  322. bg_index = V2_BAT_80_100_START_NDEX;
  323. }
  324. fill_animation_logo(bg_index + charging_low_index, fill_addr, dec_logo_addr, logo_addr,phical_screen);
  325. RECT_REGION_T tmp_rect = {(int)phical_screen.width * 4/10,
  326. (int) phical_screen.height * 1/6,
  327. (int)phical_screen.width* 5/10,
  328. (int)phical_screen.height*16/60};
  329. unsigned short tmp_num_addr[(int)phical_screen.width * phical_screen.height/100]; //addr
  330. if (capacity >= 10) {
  331. LOG_ANIM("[show_animation_common: %s %d]tmp_rect left = %d, right = %d,top = %d,bottom = %d,\n",__FUNCTION__,__LINE__,
  332. tmp_rect.left,tmp_rect.right,tmp_rect.top,tmp_rect.bottom);
  333. fill_animation_dynamic(V2_NUM_START_0_INDEX + (capacity/10), tmp_rect, fill_addr, tmp_num_addr, logo_addr, phical_screen);
  334. tmp_rect.left += (int)phical_screen.width /10;
  335. tmp_rect.right += (int)phical_screen.width /10;
  336. }
  337. LOG_ANIM("[show_animation_common: %s %d]tmp_rect left = %d, right = %d,top = %d,bottom = %d,\n",__FUNCTION__,__LINE__,
  338. tmp_rect.left,tmp_rect.right,tmp_rect.top,tmp_rect.bottom);
  339. fill_animation_dynamic(V2_NUM_START_0_INDEX + (capacity%10), tmp_rect, fill_addr, tmp_num_addr, logo_addr, phical_screen);
  340. tmp_rect.left += (int)phical_screen.width /10;
  341. tmp_rect.right += (int)phical_screen.width /10;
  342. LOG_ANIM("[show_animation_common: %s %d]tmp_rect left = %d, right = %d,top = %d,bottom = %d,\n",__FUNCTION__,__LINE__,
  343. tmp_rect.left,tmp_rect.right,tmp_rect.top,tmp_rect.bottom);
  344. fill_animation_dynamic(V2_NUM_PERCENT_INDEX, tmp_rect, fill_addr, tmp_num_addr, logo_addr, phical_screen);
  345. }
  346. }
  347. /*
  348. * Show charging animation by version
  349. *
  350. */
  351. void fill_animation_battery_by_ver(unsigned int capacity,void *fill_addr, void * dec_logo_addr, void * logo_addr,
  352. LCM_SCREEN_T phical_screen, int version)
  353. {
  354. LOG_ANIM("[show_animation_common: %s %d]version : %d\n",__FUNCTION__,__LINE__, version);
  355. switch (version)
  356. {
  357. case VERION_OLD_ANIMATION:
  358. fill_animation_battery_old(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen);
  359. break;
  360. case VERION_NEW_ANIMATION:
  361. fill_animation_battery_new(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen);
  362. break;
  363. case VERION_WIRELESS_CHARGING_ANIMATION:
  364. fill_animation_battery_wireless_charging(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen);
  365. break;
  366. default:
  367. fill_animation_battery_old(capacity, fill_addr, dec_logo_addr, logo_addr, phical_screen);
  368. break;
  369. }
  370. }