mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Use SettingsOptions::PDNegTimeout in FS2711 driver
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
#include "FS2711_defines.h"
|
#include "FS2711_defines.h"
|
||||||
#include "I2CBB2.hpp"
|
#include "I2CBB2.hpp"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
#include "Settings.h"
|
||||||
#if POW_PD_EXT == 2
|
#if POW_PD_EXT == 2
|
||||||
#include "BSP.h"
|
#include "BSP.h"
|
||||||
#include "cmsis_os.h"
|
#include "cmsis_os.h"
|
||||||
@@ -13,8 +14,6 @@
|
|||||||
#error Max PD Voltage must be defined
|
#error Max PD Voltage must be defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PROTOCOL_TIMEOUT 100 // ms
|
|
||||||
|
|
||||||
extern int32_t powerSupplyWattageLimit;
|
extern int32_t powerSupplyWattageLimit;
|
||||||
|
|
||||||
fs2711_state_t FS2711::state;
|
fs2711_state_t FS2711::state;
|
||||||
@@ -34,10 +33,11 @@ void FS2711::start() {
|
|||||||
state.req_pdo_num = 0xFF;
|
state.req_pdo_num = 0xFF;
|
||||||
|
|
||||||
enable_protocol(false);
|
enable_protocol(false);
|
||||||
osDelay(PROTOCOL_TIMEOUT);
|
// PDNegTimeout is in 1/100 s, so x10 for ms
|
||||||
|
osDelay(getSettingValue(SettingsOptions::PDNegTimeout)*10);
|
||||||
select_protocol(FS2711_PROTOCOL_PD);
|
select_protocol(FS2711_PROTOCOL_PD);
|
||||||
enable_protocol(true);
|
enable_protocol(true);
|
||||||
osDelay(PROTOCOL_TIMEOUT);
|
osDelay(getSettingValue(SettingsOptions::PDNegTimeout)*10);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t FS2711::selected_protocol() { return i2c_read(FS2711_REG_SELECT_PROTOCOL); }
|
uint8_t FS2711::selected_protocol() { return i2c_read(FS2711_REG_SELECT_PROTOCOL); }
|
||||||
|
|||||||
Reference in New Issue
Block a user