Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 1 | /* |
Casey Piper | a277d88 | 2013-10-21 10:11:04 -0700 | [diff] [blame] | 2 | * Copyright (c) 2008 Travis Geiselbrecht |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 3 | * |
lijuang | 395b5e6 | 2015-11-19 17:39:44 +0800 | [diff] [blame] | 4 | * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. |
lijuang | c518f5d | 2015-02-10 10:22:53 +0800 | [diff] [blame] | 5 | * |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 6 | * Permission is hereby granted, free of charge, to any person obtaining |
| 7 | * a copy of this software and associated documentation files |
| 8 | * (the "Software"), to deal in the Software without restriction, |
| 9 | * including without limitation the rights to use, copy, modify, merge, |
| 10 | * publish, distribute, sublicense, and/or sell copies of the Software, |
| 11 | * and to permit persons to whom the Software is furnished to do so, |
| 12 | * subject to the following conditions: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice shall be |
| 15 | * included in all copies or substantial portions of the Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 20 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 21 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 22 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 23 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 24 | */ |
| 25 | #include <err.h> |
| 26 | #include <debug.h> |
| 27 | #include <target.h> |
| 28 | #include <compiler.h> |
Pavel Nedev | a4c9d3a | 2013-05-15 14:42:34 +0300 | [diff] [blame] | 29 | #include <dload_util.h> |
Channagoud Kadabi | 41c81a6 | 2014-10-08 19:55:30 -0700 | [diff] [blame] | 30 | #include <sdhci_msm.h> |
Wufeng Jiang | 71246c2 | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 31 | #if PON_VIB_SUPPORT |
Wufeng Jiang | 1ce072f | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 32 | #include <smem.h> |
Wufeng Jiang | 71246c2 | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 33 | #include <vibrator.h> |
| 34 | #include <board.h> |
| 35 | #endif |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 36 | |
lijuang | 3606df8 | 2015-09-02 21:14:43 +0800 | [diff] [blame] | 37 | #include <smem.h> |
| 38 | #include <pm8x41_adc.h> |
| 39 | #include <pm8x41_hw.h> |
lijuang | 395b5e6 | 2015-11-19 17:39:44 +0800 | [diff] [blame] | 40 | #include <scm.h> |
lijuang | 3606df8 | 2015-09-02 21:14:43 +0800 | [diff] [blame] | 41 | |
| 42 | #if CHECK_BAT_VOLTAGE |
| 43 | #include <pm_fg_adc_usr.h> |
| 44 | #endif |
| 45 | |
Subbaraman Narayanamurthy | f17b4ae | 2011-02-16 20:19:56 -0800 | [diff] [blame] | 46 | #define EXPAND(NAME) #NAME |
| 47 | #define TARGET(NAME) EXPAND(NAME) |
lijuang | 3606df8 | 2015-09-02 21:14:43 +0800 | [diff] [blame] | 48 | |
lijuang | 6619221 | 2015-09-22 10:25:48 +0800 | [diff] [blame] | 49 | #define BATTERY_MIN_VOLTAGE 3200000 //uv |
lijuang | 3606df8 | 2015-09-02 21:14:43 +0800 | [diff] [blame] | 50 | #define PMIC_SLAVE_ID 0x20000 |
| 51 | #define BAT_IF_BAT_PRES_STATUS 0x1208 |
| 52 | |
Amol Jadi | 57abe4c | 2011-05-24 15:47:27 -0700 | [diff] [blame] | 53 | /* |
Travis Geiselbrecht | 1d0df69 | 2008-09-01 02:26:09 -0700 | [diff] [blame] | 54 | * default implementations of these routines, if the target code |
| 55 | * chooses not to implement. |
| 56 | */ |
| 57 | |
| 58 | __WEAK void target_early_init(void) |
| 59 | { |
| 60 | } |
| 61 | |
| 62 | __WEAK void target_init(void) |
| 63 | { |
| 64 | } |
| 65 | |
David Ng | 3679bc5 | 2010-02-09 15:43:43 -0800 | [diff] [blame] | 66 | __WEAK void *target_get_scratch_address(void) |
| 67 | { |
| 68 | return (void *)(SCRATCH_ADDR); |
| 69 | } |
| 70 | |
Vivek Mehta | 5f1c9d4 | 2011-04-01 20:11:59 -0700 | [diff] [blame] | 71 | __WEAK unsigned target_get_max_flash_size(void) |
| 72 | { |
| 73 | return (120 * 1024 * 1024); |
| 74 | } |
| 75 | |
Tanya Brokhman | 1c94f1a | 2015-02-15 09:05:03 +0200 | [diff] [blame] | 76 | __WEAK int flash_ubi_img(void) |
| 77 | { |
| 78 | return 0; |
| 79 | } |
| 80 | |
Tanya Brokhman | 84eaaf6 | 2015-02-24 21:57:06 +0200 | [diff] [blame] | 81 | __WEAK int update_ubi_vol(void) |
| 82 | { |
| 83 | return 0; |
| 84 | } |
| 85 | |
David Ng | 183a742 | 2009-12-07 14:55:21 -0800 | [diff] [blame] | 86 | __WEAK int target_is_emmc_boot(void) |
| 87 | { |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 88 | #if _EMMC_BOOT |
| 89 | return 1; |
| 90 | #else |
David Ng | 183a742 | 2009-12-07 14:55:21 -0800 | [diff] [blame] | 91 | return 0; |
David Ng | 025c1d9 | 2009-12-09 23:46:00 -0800 | [diff] [blame] | 92 | #endif |
David Ng | 183a742 | 2009-12-07 14:55:21 -0800 | [diff] [blame] | 93 | } |
Chandan Uddaraju | de85d3f | 2010-01-05 16:32:33 -0800 | [diff] [blame] | 94 | |
| 95 | __WEAK unsigned check_reboot_mode(void) |
| 96 | { |
| 97 | return 0; |
| 98 | } |
Chandan Uddaraju | 94183c0 | 2010-01-15 15:13:59 -0800 | [diff] [blame] | 99 | |
lijuang | c518f5d | 2015-02-10 10:22:53 +0800 | [diff] [blame] | 100 | __WEAK unsigned check_hard_reboot_mode(void) |
| 101 | { |
| 102 | return 0; |
| 103 | } |
| 104 | |
Chandan Uddaraju | 94183c0 | 2010-01-15 15:13:59 -0800 | [diff] [blame] | 105 | __WEAK void reboot_device(unsigned reboot_reason) |
| 106 | { |
| 107 | } |
Chandan Uddaraju | 7f5b901 | 2010-02-06 16:37:48 -0800 | [diff] [blame] | 108 | |
Matthew Qin | defd556 | 2014-07-11 18:02:40 +0800 | [diff] [blame] | 109 | __WEAK uint32_t is_user_force_reset(void) |
| 110 | { |
| 111 | return 0; |
| 112 | } |
| 113 | |
lijuang | 395b5e6 | 2015-11-19 17:39:44 +0800 | [diff] [blame] | 114 | __WEAK int set_download_mode(enum reboot_reason mode) |
Pavel Nedev | 76a3e21 | 2013-05-09 10:37:21 +0300 | [diff] [blame] | 115 | { |
lijuang | 395b5e6 | 2015-11-19 17:39:44 +0800 | [diff] [blame] | 116 | if(mode == NORMAL_DLOAD || mode == EMERGENCY_DLOAD) { |
| 117 | #if PLATFORM_USE_SCM_DLOAD |
| 118 | return scm_dload_mode(mode); |
| 119 | #else |
| 120 | return -1; |
| 121 | #endif |
| 122 | } |
| 123 | |
| 124 | return 0; |
Pavel Nedev | 76a3e21 | 2013-05-09 10:37:21 +0300 | [diff] [blame] | 125 | } |
| 126 | |
David Ng | f773dde | 2010-07-26 19:55:08 -0700 | [diff] [blame] | 127 | __WEAK unsigned target_pause_for_battery_charge(void) |
| 128 | { |
| 129 | return 0; |
| 130 | } |
Ajay Dudani | d04110c | 2011-01-17 23:55:07 -0800 | [diff] [blame] | 131 | |
| 132 | __WEAK unsigned target_baseband() |
| 133 | { |
| 134 | return 0; |
| 135 | } |
Subbaraman Narayanamurthy | f17b4ae | 2011-02-16 20:19:56 -0800 | [diff] [blame] | 136 | |
| 137 | __WEAK void target_serialno(unsigned char *buf) |
| 138 | { |
Ajay Dudani | f63d02f | 2011-10-01 08:29:53 -0700 | [diff] [blame] | 139 | snprintf((char *) buf, 13, "%s",TARGET(BOARD)); |
Subbaraman Narayanamurthy | f17b4ae | 2011-02-16 20:19:56 -0800 | [diff] [blame] | 140 | } |
Amol Jadi | 57abe4c | 2011-05-24 15:47:27 -0700 | [diff] [blame] | 141 | |
| 142 | __WEAK void target_fastboot_init() |
| 143 | { |
| 144 | } |
Subbaraman Narayanamurthy | 0e445b0 | 2011-06-19 21:34:46 -0700 | [diff] [blame] | 145 | |
| 146 | __WEAK int emmc_recovery_init(void) |
| 147 | { |
| 148 | return 0; |
| 149 | } |
Shashank Mittal | cd98d47 | 2011-08-02 14:29:24 -0700 | [diff] [blame] | 150 | |
| 151 | __WEAK bool target_use_signed_kernel(void) |
| 152 | { |
| 153 | #if _SIGNED_KERNEL |
| 154 | return 1; |
| 155 | #else |
| 156 | return 0; |
| 157 | #endif |
| 158 | } |
Amol Jadi | 6834f1a | 2012-06-29 14:42:59 -0700 | [diff] [blame] | 159 | |
Stanimir Varbanov | 8bc68c7 | 2013-07-08 18:22:04 +0300 | [diff] [blame] | 160 | __WEAK bool target_is_ssd_enabled(void) |
| 161 | { |
| 162 | #ifdef SSD_ENABLE |
| 163 | return 1; |
| 164 | #else |
| 165 | return 0; |
| 166 | #endif |
| 167 | } |
| 168 | |
Stanimir Varbanov | 677001e | 2013-07-18 18:16:39 +0300 | [diff] [blame] | 169 | __WEAK void target_load_ssd_keystore(void) |
| 170 | { |
| 171 | } |
Amol Jadi | 6834f1a | 2012-06-29 14:42:59 -0700 | [diff] [blame] | 172 | |
| 173 | /* Default target does not support continuous splash screen feature. */ |
| 174 | __WEAK int target_cont_splash_screen() |
| 175 | { |
| 176 | return 0; |
| 177 | } |
Amol Jadi | da118b9 | 2012-07-06 19:53:18 -0700 | [diff] [blame] | 178 | |
| 179 | /* Default target specific initialization before using USB */ |
| 180 | __WEAK void target_usb_init(void) |
| 181 | { |
| 182 | } |
| 183 | |
| 184 | /* Default target specific usb shutdown */ |
| 185 | __WEAK void target_usb_stop(void) |
| 186 | { |
| 187 | } |
Channagoud Kadabi | fa6179e | 2013-06-18 18:35:14 -0700 | [diff] [blame] | 188 | |
| 189 | /* Default target specific target uninit */ |
| 190 | __WEAK void target_uninit(void) |
| 191 | { |
| 192 | } |
Dhaval Patel | cdcb646 | 2013-07-18 14:46:57 -0700 | [diff] [blame] | 193 | |
Padmanabhan Komanduru | bccbcdc | 2015-06-30 16:19:24 +0530 | [diff] [blame] | 194 | __WEAK bool target_display_panel_node(char *pbuf, uint16_t buf_size) |
Dhaval Patel | cdcb646 | 2013-07-18 14:46:57 -0700 | [diff] [blame] | 195 | { |
| 196 | return false; |
| 197 | } |
Channagoud Kadabi | 9fbdcdf | 2013-09-19 16:24:16 -0700 | [diff] [blame] | 198 | |
Aravind Venkateswaran | 6385f7e | 2014-02-25 16:45:11 -0800 | [diff] [blame] | 199 | __WEAK void target_display_init(const char *panel_name) |
Aravind Venkateswaran | dd50c1a | 2014-02-25 14:42:43 -0800 | [diff] [blame] | 200 | { |
| 201 | } |
| 202 | |
| 203 | __WEAK void target_display_shutdown(void) |
| 204 | { |
| 205 | } |
| 206 | |
Casey Piper | f8cebb6 | 2013-09-11 15:56:17 -0700 | [diff] [blame] | 207 | __WEAK uint8_t target_panel_auto_detect_enabled() |
| 208 | { |
| 209 | return 0; |
| 210 | } |
| 211 | |
Casey Piper | 48bfc0d | 2013-11-18 13:24:35 -0800 | [diff] [blame] | 212 | __WEAK uint8_t target_is_edp() |
| 213 | { |
| 214 | return 0; |
| 215 | } |
| 216 | |
Amol Jadi | 417c7f2 | 2013-10-07 12:52:21 -0700 | [diff] [blame] | 217 | /* default usb controller to be used. */ |
| 218 | __WEAK const char * target_usb_controller() |
| 219 | { |
| 220 | return "ci"; |
| 221 | } |
Amol Jadi | 9ff7bb5 | 2013-10-11 14:11:45 -0700 | [diff] [blame] | 222 | |
| 223 | /* override for target specific usb phy reset. */ |
| 224 | __WEAK void target_usb_phy_reset(void) |
| 225 | { |
| 226 | } |
Hanumant Singh | 8e1ac23 | 2014-01-29 13:41:51 -0800 | [diff] [blame] | 227 | |
| 228 | /* determine if target is in warm boot. */ |
| 229 | __WEAK bool target_warm_boot(void) |
| 230 | { |
| 231 | return false; |
| 232 | } |
Aparna Mallavarapu | 373d38b | 2014-05-23 14:47:19 +0530 | [diff] [blame] | 233 | |
| 234 | /* Determine the HLOS subtype of the target */ |
| 235 | __WEAK uint32_t target_get_hlos_subtype(void) |
| 236 | { |
| 237 | return 0; |
| 238 | } |
Channagoud Kadabi | 82cf5c6 | 2014-08-24 22:17:34 -0700 | [diff] [blame] | 239 | |
| 240 | /* Initialize crypto parameters */ |
| 241 | __WEAK void target_crypto_init_params() |
| 242 | { |
| 243 | } |
Channagoud Kadabi | 41c81a6 | 2014-10-08 19:55:30 -0700 | [diff] [blame] | 244 | |
| 245 | /* Default CFG delay value */ |
| 246 | __WEAK uint32_t target_ddr_cfg_val() |
| 247 | { |
| 248 | return DDR_CONFIG_VAL; |
| 249 | } |
Channagoud Kadabi | 2021cef | 2015-02-25 12:08:32 -0800 | [diff] [blame] | 250 | |
Wufeng Jiang | 71246c2 | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 251 | #if PON_VIB_SUPPORT |
Parth Dixit | 7f68371 | 2015-12-23 15:59:16 +0530 | [diff] [blame] | 252 | void get_vibration_type(struct qpnp_hap *config) |
Wufeng Jiang | 71246c2 | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 253 | { |
Wufeng Jiang | 71246c2 | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 254 | uint32_t hw_id = board_hardware_id(); |
| 255 | uint32_t platform = board_platform_id(); |
Parth Dixit | 7f68371 | 2015-12-23 15:59:16 +0530 | [diff] [blame] | 256 | |
| 257 | config->vib_type = VIB_ERM_TYPE; |
| 258 | config->hap_rate_cfg1 = QPNP_HAP_RATE_CFG1_1c; |
| 259 | config->hap_rate_cfg2 = QPNP_HAP_RATE_CFG2_04; |
Wufeng Jiang | 71246c2 | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 260 | switch(hw_id){ |
| 261 | case HW_PLATFORM_MTP: |
| 262 | switch(platform){ |
| 263 | case MSM8952: |
Parth Dixit | 7f68371 | 2015-12-23 15:59:16 +0530 | [diff] [blame] | 264 | config->vib_type = VIB_ERM_TYPE; |
Wufeng Jiang | 71246c2 | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 265 | break; |
| 266 | case MSM8976: |
vijay kumar | e928724 | 2015-09-04 18:40:15 +0530 | [diff] [blame] | 267 | case MSM8956: |
| 268 | case APQ8056: |
Parth Dixit | 7f68371 | 2015-12-23 15:59:16 +0530 | [diff] [blame] | 269 | config->vib_type = VIB_LRA_TYPE; |
Wufeng Jiang | 71246c2 | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 270 | break; |
Parth Dixit | 7f68371 | 2015-12-23 15:59:16 +0530 | [diff] [blame] | 271 | case MSM8937: |
| 272 | case APQ8037: |
Parth Dixit | 049a2d7 | 2016-01-29 14:42:43 +0530 | [diff] [blame] | 273 | case MSMGOLD: |
| 274 | case MSMGOLD2: |
| 275 | case MSMGOLD3: |
| 276 | case APQGOLD: |
Gaurav Nebhwani | 8e20d83 | 2016-02-12 15:07:58 +0530 | [diff] [blame] | 277 | case MSMTITANIUM: |
| 278 | case APQTITANIUM: |
Parth Dixit | 7f68371 | 2015-12-23 15:59:16 +0530 | [diff] [blame] | 279 | config->vib_type = VIB_LRA_TYPE; |
| 280 | config->hap_rate_cfg1 = QPNP_HAP_RATE_CFG1_41; |
| 281 | config->hap_rate_cfg2 = QPNP_HAP_RATE_CFG2_03; |
Gaurav Nebhwani | 8e20d83 | 2016-02-12 15:07:58 +0530 | [diff] [blame] | 282 | break; |
vijay kumar | e928724 | 2015-09-04 18:40:15 +0530 | [diff] [blame] | 283 | default: |
| 284 | dprintf(CRITICAL,"Unsupported platform id\n"); |
| 285 | break; |
Wufeng Jiang | 71246c2 | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 286 | } |
| 287 | break; |
| 288 | case HW_PLATFORM_QRD: |
Parth Dixit | 7f68371 | 2015-12-23 15:59:16 +0530 | [diff] [blame] | 289 | config->vib_type = VIB_ERM_TYPE; |
Wufeng Jiang | 71246c2 | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 290 | break; |
vijay kumar | e928724 | 2015-09-04 18:40:15 +0530 | [diff] [blame] | 291 | default: |
Parth Dixit | 7f68371 | 2015-12-23 15:59:16 +0530 | [diff] [blame] | 292 | dprintf(CRITICAL,"Unsupported hardware id\n"); |
vijay kumar | e928724 | 2015-09-04 18:40:15 +0530 | [diff] [blame] | 293 | break; |
Wufeng Jiang | 71246c2 | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 294 | } |
Wufeng Jiang | 71246c2 | 2015-08-06 19:07:09 +0800 | [diff] [blame] | 295 | } |
| 296 | #endif |
| 297 | |
Channagoud Kadabi | 2021cef | 2015-02-25 12:08:32 -0800 | [diff] [blame] | 298 | /* Return Build variant */ |
| 299 | __WEAK bool target_build_variant_user() |
| 300 | { |
| 301 | #if USER_BUILD_VARIANT |
| 302 | return true; |
| 303 | #else |
| 304 | return false; |
| 305 | #endif |
| 306 | } |
lijuang | 3606df8 | 2015-09-02 21:14:43 +0800 | [diff] [blame] | 307 | |
| 308 | __WEAK uint32_t target_get_pmic() |
| 309 | { |
| 310 | return PMIC_IS_UNKNOWN; |
| 311 | } |
| 312 | |
| 313 | /* Check battery if it's exist */ |
| 314 | bool target_battery_is_present() |
| 315 | { |
| 316 | bool batt_is_exist; |
| 317 | uint8_t value = 0; |
| 318 | uint32_t pmic; |
| 319 | |
| 320 | pmic = target_get_pmic(); |
| 321 | |
| 322 | switch(pmic) |
| 323 | { |
| 324 | case PMIC_IS_PM8909: |
| 325 | case PMIC_IS_PM8916: |
| 326 | case PMIC_IS_PM8941: |
| 327 | value = REG_READ(BAT_IF_BAT_PRES_STATUS); |
| 328 | break; |
| 329 | case PMIC_IS_PMI8950: |
| 330 | case PMIC_IS_PMI8994: |
| 331 | case PMIC_IS_PMI8996: |
| 332 | value = REG_READ(PMIC_SLAVE_ID| |
| 333 | BAT_IF_BAT_PRES_STATUS); |
| 334 | break; |
| 335 | default: |
| 336 | dprintf(CRITICAL, "ERROR: Couldn't get the pmic type\n"); |
| 337 | break; |
| 338 | } |
| 339 | |
| 340 | batt_is_exist = value >> 7; |
| 341 | |
| 342 | return batt_is_exist; |
| 343 | |
| 344 | } |
| 345 | |
| 346 | #if CHECK_BAT_VOLTAGE |
| 347 | /* Return battery voltage */ |
| 348 | uint32_t target_get_battery_voltage() |
| 349 | { |
| 350 | uint32_t pmic; |
| 351 | uint32_t vbat = 0; |
| 352 | |
| 353 | pmic = target_get_pmic(); |
| 354 | |
| 355 | switch(pmic) |
| 356 | { |
| 357 | case PMIC_IS_PM8909: |
| 358 | case PMIC_IS_PM8916: |
| 359 | case PMIC_IS_PM8941: |
| 360 | vbat = pm8x41_get_batt_voltage(); //uv |
| 361 | break; |
| 362 | case PMIC_IS_PMI8950: |
| 363 | case PMIC_IS_PMI8994: |
| 364 | case PMIC_IS_PMI8996: |
| 365 | if (!pm_fg_usr_get_vbat(1, &vbat)) { |
| 366 | vbat = vbat*1000; //uv |
| 367 | } else { |
| 368 | dprintf(CRITICAL, "ERROR: Get battery voltage failed!!!\n"); |
| 369 | } |
| 370 | break; |
| 371 | default: |
| 372 | dprintf(CRITICAL, "ERROR: Couldn't get the pmic type\n"); |
| 373 | break; |
| 374 | } |
| 375 | |
| 376 | return vbat; |
| 377 | } |
| 378 | |
| 379 | /* Add safeguards such as refusing to flash if minimum battery levels |
| 380 | * are not present or be bypass if the device doesn't have a battery |
| 381 | */ |
| 382 | bool target_battery_soc_ok() |
| 383 | { |
| 384 | if (!target_battery_is_present()) { |
| 385 | dprintf(INFO, "battery is not present\n"); |
| 386 | return true; |
| 387 | } |
| 388 | |
| 389 | if (target_get_battery_voltage() >= BATTERY_MIN_VOLTAGE) |
| 390 | return true; |
| 391 | |
| 392 | return false; |
| 393 | } |
| 394 | #endif |