| Index: emcore/trunk/target/ipodnano2g/power.c |
| — | — | @@ -105,11 +105,6 @@ |
| 106 | 106 | return -1;
|
| 107 | 107 | }
|
| 108 | 108 |
|
| 109 | | -int read_input_mw(int battery)
|
| 110 | | -{
|
| 111 | | - return -1;
|
| 112 | | -}
|
| 113 | | -
|
| 114 | 109 | enum battery_state read_battery_state(int battery)
|
| 115 | 110 | {
|
| 116 | 111 | if (battery != 0) return BATTERY_STATE_INVALID;
|
| — | — | @@ -117,3 +112,25 @@ |
| 118 | 113 | if (external_power_state()) return BATTERY_STATE_IDLE;
|
| 119 | 114 | return BATTERY_STATE_DISCHARGING;
|
| 120 | 115 | }
|
| | 116 | +
|
| | 117 | +int read_input_voltage(int input)
|
| | 118 | +{
|
| | 119 | + return -1;
|
| | 120 | +}
|
| | 121 | +
|
| | 122 | +int read_input_current(int input)
|
| | 123 | +{
|
| | 124 | + return -1;
|
| | 125 | +}
|
| | 126 | +
|
| | 127 | +int read_input_mw(int input)
|
| | 128 | +{
|
| | 129 | + return -1;
|
| | 130 | +}
|
| | 131 | +
|
| | 132 | +enum input_state read_input_state(int input)
|
| | 133 | +{
|
| | 134 | + if (input != 0) return INPUT_STATE_INVALID;
|
| | 135 | + if (external_power_state()) return INPUT_STATE_ACTIVE;
|
| | 136 | + return INPUT_STATE_NONPRESENT;
|
| | 137 | +}
|
| Index: emcore/trunk/target/ipodnano3g/power.c |
| — | — | @@ -94,11 +94,6 @@ |
| 95 | 95 | return -1;
|
| 96 | 96 | }
|
| 97 | 97 |
|
| 98 | | -int read_input_mw(int battery)
|
| 99 | | -{
|
| 100 | | - return -1;
|
| 101 | | -}
|
| 102 | | -
|
| 103 | 98 | enum battery_state read_battery_state(int battery)
|
| 104 | 99 | {
|
| 105 | 100 | if (battery != 0) return BATTERY_STATE_INVALID;
|
| — | — | @@ -106,3 +101,25 @@ |
| 107 | 102 | if (external_power_state()) return BATTERY_STATE_IDLE;
|
| 108 | 103 | return BATTERY_STATE_DISCHARGING;
|
| 109 | 104 | }
|
| | 105 | +
|
| | 106 | +int read_input_voltage(int input)
|
| | 107 | +{
|
| | 108 | + return -1;
|
| | 109 | +}
|
| | 110 | +
|
| | 111 | +int read_input_current(int input)
|
| | 112 | +{
|
| | 113 | + return -1;
|
| | 114 | +}
|
| | 115 | +
|
| | 116 | +int read_input_mw(int input)
|
| | 117 | +{
|
| | 118 | + return -1;
|
| | 119 | +}
|
| | 120 | +
|
| | 121 | +enum input_state read_input_state(int input)
|
| | 122 | +{
|
| | 123 | + if (input != 0) return INPUT_STATE_INVALID;
|
| | 124 | + if (external_power_state()) return INPUT_STATE_ACTIVE;
|
| | 125 | + return INPUT_STATE_NONPRESENT;
|
| | 126 | +}
|
| Index: emcore/trunk/export/syscallwrappers.h |
| — | — | @@ -217,8 +217,11 @@ |
| 218 | 218 | #define read_battery_mwh_full __emcore_syscall->read_battery_mwh_full |
| 219 | 219 | #define read_battery_mwh_current __emcore_syscall->read_battery_mwh_current |
| 220 | 220 | #define read_battery_mw __emcore_syscall->read_battery_mw |
| | 221 | +#define read_battery_state __emcore_syscall->read_battery_state |
| | 222 | +#define read_input_voltage __emcore_syscall->read_input_voltage |
| | 223 | +#define read_input_current __emcore_syscall->read_input_current |
| 221 | 224 | #define read_input_mw __emcore_syscall->read_input_mw |
| 222 | | -#define read_battery_state __emcore_syscall->read_battery_state |
| | 225 | +#define read_input_state __emcore_syscall->read_input_state |
| 223 | 226 | #define tlsf_realign __emcore_syscall->tlsf_realign |
| 224 | 227 | #define realign __emcore_syscall->realign |
| 225 | 228 | #define fat_size_mv __emcore_syscall->fat_size_mv |
| Index: emcore/trunk/export/syscallapi.h |
| — | — | @@ -277,8 +277,11 @@ |
| 278 | 278 | typeof(read_battery_mwh_full) *read_battery_mwh_full; |
| 279 | 279 | typeof(read_battery_mwh_current) *read_battery_mwh_current; |
| 280 | 280 | typeof(read_battery_mw) *read_battery_mw; |
| | 281 | + typeof(read_battery_state) *read_battery_state; |
| | 282 | + typeof(read_input_voltage) *read_input_voltage; |
| | 283 | + typeof(read_input_current) *read_input_current; |
| 281 | 284 | typeof(read_input_mw) *read_input_mw; |
| 282 | | - typeof(read_battery_state) *read_battery_state; |
| | 285 | + typeof(read_input_state) *read_input_state; |
| 283 | 286 | typeof(tlsf_realign) *tlsf_realign; |
| 284 | 287 | typeof(realign) *realign; |
| 285 | 288 | typeof(fat_size_mv) *fat_size_mv; |
| Index: emcore/trunk/power.h |
| — | — | @@ -38,7 +38,17 @@ |
| 39 | 39 | BATTERY_STATE_DISCHARGING
|
| 40 | 40 | };
|
| 41 | 41 |
|
| | 42 | +enum input_state
|
| | 43 | +{
|
| | 44 | + INPUT_STATE_UNKNOWN,
|
| | 45 | + INPUT_STATE_INVALID,
|
| | 46 | + INPUT_STATE_NONPRESENT,
|
| | 47 | + INPUT_STATE_OUTOFRANGE,
|
| | 48 | + INPUT_STATE_IDLE,
|
| | 49 | + INPUT_STATE_ACTIVE
|
| | 50 | +};
|
| 42 | 51 |
|
| | 52 | +
|
| 43 | 53 | void power_off(void);
|
| 44 | 54 | void power_init(void) INITCODE_ATTR;
|
| 45 | 55 | bool charging_state(void);
|
| — | — | @@ -50,8 +60,11 @@ |
| 51 | 61 | int read_battery_mwh_full(int battery);
|
| 52 | 62 | int read_battery_mwh_current(int battery);
|
| 53 | 63 | int read_battery_mw(int battery);
|
| 54 | | -int read_input_mw(int battery);
|
| 55 | 64 | enum battery_state read_battery_state(int battery);
|
| | 65 | +int read_input_voltage(int input);
|
| | 66 | +int read_input_current(int input);
|
| | 67 | +int read_input_mw(int input);
|
| | 68 | +enum input_state read_input_state(int input);
|
| 56 | 69 |
|
| 57 | 70 |
|
| 58 | 71 | #endif
|
| Index: emcore/trunk/syscallapi.c |
| — | — | @@ -240,8 +240,11 @@ |
| 241 | 241 | .read_battery_mwh_full = read_battery_mwh_full, |
| 242 | 242 | .read_battery_mwh_current = read_battery_mwh_current, |
| 243 | 243 | .read_battery_mw = read_battery_mw, |
| | 244 | + .read_battery_state = read_battery_state, |
| | 245 | + .read_input_voltage = read_input_voltage, |
| | 246 | + .read_input_current = read_input_current, |
| 244 | 247 | .read_input_mw = read_input_mw, |
| 245 | | - .read_battery_state = read_battery_state, |
| | 248 | + .read_input_state = read_input_state, |
| 246 | 249 | .tlsf_realign = tlsf_realign, |
| 247 | 250 | .realign = realign, |
| 248 | 251 | #ifdef HAVE_STORAGE |