Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
524 commits
Select commit Hold shift + click to select a range
495c1b9
Fix int32_t to uint32_t
Apr 29, 2024
1fc7f22
Fix conf setting
Apr 30, 2024
6494847
add static
Apr 30, 2024
12d493e
Fix init_arg conf and cur_lsb
Apr 30, 2024
cd7ad93
Move ina238 offset to own h file
Apr 30, 2024
c9c1541
Fix probleam
Apr 30, 2024
574874f
Fix bug
Apr 30, 2024
118e14d
Fix coding style
Apr 30, 2024
8e82800
support MODBUS FRU RW
matt-lzy Apr 30, 2024
e6299f0
Add is_init check
Apr 30, 2024
af90fdb
modify arg0 in modbus_command_mapping as fru-id for modbus fru rw cmds
matt-lzy Apr 30, 2024
f906ec9
Add adc range hook init setting
Apr 30, 2024
1ecb073
Delete unused line
Apr 30, 2024
f5d5b44
Merge pull request #69 from matt-lzy/Add_dev_INA238
khoung76642 Apr 30, 2024
5382b71
Fix sdr & sensortable size not same
Apr 30, 2024
3d3c64a
support modbus cmd for fw update: rpu stop
matt-lzy Apr 30, 2024
bf63f32
Fix sensortable pal_extend_sensor_config and add sdr_tablepal_get_ext…
May 2, 2024
d6a31ae
Delete pal_extend_sensor_conf
May 2, 2024
fe7ac7f
add pwm device & function
HungYi-Li May 2, 2024
63b12b5
Merge branch 'AALC-PreDev' into add_pwm_ctl
HungYi-Li May 2, 2024
c3d8ca5
Update sensor.c
HungYi-Li May 2, 2024
0011af5
Merge pull request #73 from matt-lzy/add_pwm_ctl
HungYi-Li May 2, 2024
a31609d
Change extend function to load hsc/temp sensor conf function
May 2, 2024
b0a16f0
Add commit
May 2, 2024
e21b4ab
xdp710 wait to add table
May 2, 2024
44d56b4
Merge pull request #74 from matt-lzy/Fix_sensor_table_size_and_change…
khoung76642 May 2, 2024
7209b91
modify gpio table
HungYi-Li May 2, 2024
20e7eaa
Merge pull request #75 from matt-lzy/modify_gpio_table
HungYi-Li May 2, 2024
05149b8
Merge branch 'AALC-PreDev' into Matt_modbusRPUStop2
matt-lzy May 2, 2024
34b586c
add port variable for function nct7363_set_duty
matt-lzy May 2, 2024
02774a4
tested nct7363 driver and fix bug
May 3, 2024
35739e3
Remove debug LOG_WRN line
May 3, 2024
9d27ecd
Add commit
May 3, 2024
d01b87c
chamge leak sensor name and update modbus new address
May 3, 2024
a5fb958
modify ast pwm
HungYi-Li May 3, 2024
1d28c18
Delete unused line
May 3, 2024
8f3f2f7
Merge pull request #78 from matt-lzy/Update_sensor_name_and_modbus_ta…
HungYi-Li May 3, 2024
914e308
Add alter latch enable
May 3, 2024
ece4630
remove set threshold port
May 3, 2024
3ed9f2a
Remove unused line
May 3, 2024
b79c32c
Fix bug
May 3, 2024
d4aa8a6
Fix bug
May 3, 2024
6c10bde
Fix bug
May 3, 2024
3e22d36
Fix bug
May 3, 2024
bd882f5
temp
May 6, 2024
d11aa80
Fix if fan_pole < 0
May 6, 2024
99c8668
Fix fan_pole
May 6, 2024
cae858d
Add fan_poles = 0 fail
May 6, 2024
2eabb19
change fan_poles init not 0
May 6, 2024
4d18cb8
Merge pull request #77 from matt-lzy/modify_ast_pwm
HungYi-Li May 6, 2024
3c9b5bb
fix fw-update:enable SPI config & reg reverse
matt-lzy May 6, 2024
4a34ca0
Merge pull request #71 from matt-lzy/Matt_modbusRPUStop2
HungYi-Li May 6, 2024
54044d4
move ina238_init_arg to ina238.g
May 6, 2024
16dc860
Remove test log
May 6, 2024
897c5f9
Merge branch 'AALC-PreDev' into Add_INA238_Enable_Alert_Latch
khoung76642 May 6, 2024
f588fdf
remove test function
May 6, 2024
efef267
Fix coding style
May 6, 2024
bfec9bd
Add commit in ina238 define
May 6, 2024
6c77b73
Fix bug and tested value
May 6, 2024
be951f9
Delete test log
May 6, 2024
b8c3d7d
define some value
May 6, 2024
381c07f
change fan_pole to ==0
May 6, 2024
c814a4a
change reg define name
May 6, 2024
7a30a86
Merge branch 'AALC-PreDev' into Matt_modbusRWFRU2
matt-lzy May 6, 2024
8b7d03d
Add read conf and write setting
May 6, 2024
2c1d753
Fix bug
May 6, 2024
a51ecdf
Merge pull request #79 from matt-lzy/Add_INA238_Enable_Alert_Latch
HungYi-Li May 6, 2024
be0311b
Merge branch 'AALC-PreDev' into Tested_dev_NCT7363_driver
khoung76642 May 6, 2024
31c961b
Merge pull request #76 from matt-lzy/Tested_dev_NCT7363_driver
khoung76642 May 6, 2024
6c8f0a8
Fix fraction value
May 6, 2024
dc4af12
Merge branch 'AALC-PreDev' into Tested_NCT214
khoung76642 May 6, 2024
b18cb92
Delete unused line
May 6, 2024
f6fc1bc
Merge pull request #80 from matt-lzy/Tested_NCT214
khoung76642 May 6, 2024
15159c4
move to head
May 6, 2024
e9c20a6
Fix temperature range select define
May 6, 2024
a6f69cd
Merge pull request #83 from matt-lzy/Fix_NCT214_TEMPERATURE_RANGE_SEL…
khoung76642 May 6, 2024
da62ebd
Merge pull request #82 from matt-lzy/Fix_NCT7363_init_arg_move_to_hea…
khoung76642 May 6, 2024
b386842
Merge branch 'AALC-PreDev' into Matt_sync24240504_ec13238
matt-lzy May 6, 2024
bcb66ac
sync 240504 patch number
matt-lzy May 6, 2024
eaaff31
Delete fix_patch/tag_v00.01.06_d014527731033db477f806f5bff2e1ca5d4b2b…
matt-lzy May 6, 2024
202d7e1
Merge pull request #81 from matt-lzy/Matt_sync24240504_ec13238
HungYi-Li May 7, 2024
d4ed7e9
Merge pull request #70 from matt-lzy/Matt_modbusRWFRU2
HungYi-Li May 7, 2024
3f097c2
add function for reverting regs
matt-lzy May 7, 2024
08bda99
Merge pull request #85 from matt-lzy/Matt_ModbusRegRevert
HungYi-Li May 7, 2024
d69260a
fix modbus patch
matt-lzy May 7, 2024
300f452
Add temperature range setting
May 7, 2024
b8715ce
Merge pull request #86 from matt-lzy/Matt_modifyModbusPatch
HungYi-Li May 7, 2024
2515c92
add: extend modbus rtu timeout patch
HungYi-Li May 7, 2024
a77484b
remove invalied change
matt-lzy May 7, 2024
2da82cc
Merge pull request #88 from matt-lzy/add_extend_modbus_rtu_timeout_patch
matt-lzy May 8, 2024
a063b4f
temp
May 8, 2024
3922e90
Merge pull request #87 from matt-lzy/NCT214_Add_TEMPERATURE_RANGE_SET…
HungYi-Li May 8, 2024
be0cd76
Fix coding style
May 8, 2024
f8d5f4e
Merge pull request #89 from matt-lzy/Fix_NCT214_coding_style
khoung76642 May 8, 2024
36dd4ca
fix modbus patch
HungYi-Li May 8, 2024
0dcd806
Merge pull request #90 from matt-lzy/fix_modbus_patch
matt-lzy May 8, 2024
b0396c0
modify xdp710
HungYi-Li May 9, 2024
1766490
Add temp range setting
May 9, 2024
a5fe3f4
Merge pull request #92 from matt-lzy/modify_nct214
khoung76642 May 9, 2024
67fe02d
update to v07
May 9, 2024
48598ca
Add modbus commands
May 9, 2024
e21d80a
2 regs fw version format
matt-lzy May 9, 2024
5749302
Merge pull request #91 from matt-lzy/modify_xdp710
HungYi-Li May 10, 2024
28ea84c
Fix sensortable pdb polling setting
May 10, 2024
6e75c4e
Merge pull request #93 from matt-lzy/Update_sensor_sdr_table_to_v07
HungYi-Li May 10, 2024
d1a8103
FW Version supports ASCII format
matt-lzy May 10, 2024
8b57b2f
temp
May 10, 2024
83992a4
Fix space tab bug
May 10, 2024
7b1c74a
move init args from sensor.h to own header file
May 10, 2024
409dfe2
add ads112c ifdef
May 10, 2024
7df975a
fix define
May 10, 2024
0c61d9b
Merge pull request #95 from matt-lzy/NCT7363_add_own_pin_fan_pole_set…
khoung76642 May 10, 2024
a94d09f
Merge pull request #96 from matt-lzy/move_init_args_to_own_header
khoung76642 May 10, 2024
6f786c8
Merge pull request #94 from matt-lzy/matt_2RegsFWversion
HungYi-Li May 13, 2024
0da21fe
modify_update_action
HungYi-Li May 13, 2024
1b49a89
Merge pull request #97 from HungYi-Li/add_wram_reset_in_rpu_start
matt-lzy May 14, 2024
f54691d
temp
May 15, 2024
38bcffd
Add plat_hook xdp710 init_args
May 15, 2024
1a5e050
Merge pull request #99 from matt-lzy/Add_sensortable_switch_adm1272_o…
HungYi-Li May 15, 2024
e74e0fe
add sensor threshold thread
HungYi-Li May 16, 2024
308e0e6
Add modbus commands
May 16, 2024
af9d74c
Merge pull request #101 from matt-lzy/add_threshold_thread
matt-lzy May 16, 2024
c5566cd
delete fru and fix error log
May 16, 2024
8acf849
fix us_command_list_without_callback_function
May 16, 2024
309eaae
add plat def sensor
HungYi-Li May 17, 2024
75992b7
modify calculate_total_val func
HungYi-Li May 17, 2024
a273cb8
temp save
May 17, 2024
597a21a
modify modbus_get_senser_reading
HungYi-Li May 17, 2024
108eee1
Add ads1015 driver
May 17, 2024
ec030e6
fix codeing style
May 20, 2024
f55abfe
add sensor board temp sensor determination
May 20, 2024
5f00742
Add function
May 20, 2024
47a3886
Fix bug and coding style
May 20, 2024
184ef3d
Fix 2 complement function define
May 20, 2024
c249564
Fix int define
May 20, 2024
dccfba0
Merge pull request #105 from matt-lzy/Add_dev_ads1015
khoung76642 May 20, 2024
327dc1d
fix size
May 21, 2024
5c43fba
modify threshold and other
HungYi-Li May 21, 2024
b4113bc
Merge pull request #107 from matt-lzy/add_threshold_and_other
matt-lzy May 22, 2024
b6a2442
support log in eeprom
matt-lzy May 23, 2024
237c011
add the pumpduty setting for log
matt-lzy May 23, 2024
874b658
add LOG_BEGIN_MODBUS_ADDR
matt-lzy May 23, 2024
085f575
fix plat_contril.c and change i2c w/r modbus address
May 23, 2024
696b191
Fix include
May 23, 2024
087b486
update function
May 23, 2024
86be7bd
delete unused line
May 23, 2024
ad497b1
Ken says it's OK
matt-lzy May 23, 2024
1486bea
include plat_log.h
May 24, 2024
28e6c68
log fiexed
matt-lzy May 24, 2024
c1ee9af
modbus cmd to plat_modbus
matt-lzy May 24, 2024
93a560b
fix function
May 27, 2024
ffd569f
delete unused line
May 27, 2024
597be8b
Merge pull request #110 from matt-lzy/matt_modbusCMDtoplat_modbus.c
matt-lzy May 27, 2024
19e4d47
Merge branch 'AALC-PreDev' into matt_eepromLogSupport
matt-lzy May 27, 2024
bde7ea0
support empty eeprom log(0xFF)
matt-lzy May 27, 2024
8cda96b
support pow_of_10
matt-lzy May 27, 2024
179730f
Merge pull request #108 from matt-lzy/matt_eepromLogSupport
matt-lzy May 27, 2024
bc83c14
add plat eeprom write/read
HungYi-Li May 27, 2024
a2a85b6
add hmi version size comment
HungYi-Li May 27, 2024
2bba2d1
Change coding style to array
May 27, 2024
28a674f
Merge pull request #111 from matt-lzy/add_eeprom_write_read
matt-lzy May 27, 2024
2e4c41d
Merge pull request #102 from matt-lzy/Add_modbus_command_list_without…
matt-lzy May 27, 2024
c2ee4ba
temp save
May 27, 2024
3cc9cf0
Merge branch 'AALC-PreDev' into Fix_modbus_pump_setting_error
May 27, 2024
eaa5a14
put log command into plat_modbus code
matt-lzy May 27, 2024
a840e9f
add bit value in *fn
May 27, 2024
3ce443f
add check bit_val
May 27, 2024
9b0027c
Add bit_value define
May 27, 2024
ff4ccc9
fix sizeof(modbus_err_log_mapping)
matt-lzy May 27, 2024
bd1bce7
read/write data length has to be less EEPROM_WRITE_SIZE(32)
matt-lzy May 27, 2024
ff5605e
Merge pull request #112 from matt-lzy/Matt_logCMDtoPlatModbus
HungYi-Li May 28, 2024
dd39e94
Merge pull request #106 from matt-lzy/Determine_sensorboard_temp_sensor
HungYi-Li May 28, 2024
6e6344d
move pump setting back to plat_modbus.c
May 28, 2024
b7743ff
delete unused line
May 28, 2024
5f8a211
rename plat_control to plat_hwm
May 28, 2024
2789025
change name hwm->hwmon
May 28, 2024
7e6a4e1
fix merge conflict
May 28, 2024
6f38966
Merge pull request #109 from matt-lzy/Fix_modbus_pump_setting_error
HungYi-Li May 28, 2024
36f4e5d
modify threshold
HungYi-Li May 28, 2024
5fb0f86
Merge pull request #113 from matt-lzy/modify_threshold
matt-lzy May 28, 2024
7013bac
Merge branch 'AALC-PreDev' into main
matt-lzy May 28, 2024
a1ec4a1
Merge pull request #114 from matt-lzy/main
matt-lzy May 28, 2024
002711a
command code format
matt-lzy May 28, 2024
7310f9a
Merge pull request #115 from matt-lzy/Matt_formatCommanCode
matt-lzy May 28, 2024
8983de4
Fix pinctrl
May 29, 2024
7501fca
Merge pull request #116 from matt-lzy/Fix_ast1030_dts_i2c_pinctrl
matt-lzy May 30, 2024
e891ea8
Add uart3
May 30, 2024
b56f3a7
add meta-facebook/aalc_predev/src/platform/plat_sensor_table.c
matt-lzy Jun 3, 2024
31ce1fd
fix hdc1080_init_args
matt-lzy Jun 3, 2024
7243098
Update plat_sensor_table.c
matt-lzy Jun 3, 2024
7497a23
Update plat_hook.c
matt-lzy Jun 3, 2024
05dae35
temp save
Jun 4, 2024
407debc
Fix nct7363 and adm1272 init_args setting and fix hsc_config change t…
Jun 4, 2024
62ee970
Fix sensor box temp sensor init_args
Jun 5, 2024
fb77bfa
Fix xdp_init setting
Jun 5, 2024
bb89f13
set adm1272 r sense
Jun 5, 2024
1c65a5b
Fix hsc_config for change xdp710 address
Jun 5, 2024
b84a388
Merge pull request #117 from matt-lzy/Add_ast1030_dts_uart3_enable
HungYi-Li Jun 6, 2024
72e8c02
Merge pull request #118 from matt-lzy/matt_hdc1080InitArg
HungYi-Li Jun 6, 2024
7a00ef3
Merge pull request #119 from matt-lzy/Add_adm1272_xdp710_init_arg_res…
khoung76642 Jun 6, 2024
d08d4c8
Merge branch 'AALC-PreDev' into main
matt-lzy Jun 6, 2024
020e645
Revert "Merge branch 'AALC-PreDev' into main"
matt-lzy Jun 6, 2024
845472f
Merge branch 'facebook:main' into main
matt-lzy Jun 11, 2024
ac6efa1
Merge branch 'facebook:main' into main
matt-lzy Jun 13, 2024
5adc98f
Merge branch 'facebook:main' into main
khoung76642 Jun 14, 2024
df38fa4
Merge branch 'facebook:main' into main
matt-lzy Jun 17, 2024
cfef135
Merge branch 'facebook:main' into main
matt-lzy Jun 18, 2024
583f063
Merge branch 'facebook:main' into main
matt-lzy Jun 19, 2024
83c8c7e
Merge branch 'facebook:main' into main
matt-lzy Jun 20, 2024
69f2c36
Merge branch 'facebook:main' into main
matt-lzy Jun 25, 2024
1878f43
Merge branch 'facebook:main' into main
matt-lzy Jul 31, 2024
6e98a13
Merge branch 'facebook:main' into main
matt-lzy Aug 6, 2024
1f0b859
Merge branch 'facebook:main' into main
matt-lzy Aug 19, 2024
8135dd0
Merge branch 'facebook:main' into main
matt-lzy Aug 22, 2024
124a492
Merge branch 'facebook:main' into main
matt-lzy Aug 23, 2024
5560b0b
Merge branch 'facebook:main' into main
matt-lzy Aug 26, 2024
6c4d142
Merge branch 'facebook:main' into main
matt-lzy Aug 28, 2024
77c5e58
Merge branch 'facebook:main' into main
matt-lzy Sep 5, 2024
cf20033
Merge branch 'facebook:main' into main
matt-lzy Sep 9, 2024
986318e
Merge branch 'facebook:main' into main
matt-lzy Sep 16, 2024
866980e
Merge branch 'facebook:main' into main
matt-lzy Sep 19, 2024
aa0f4e3
Merge branch 'facebook:main' into main
matt-lzy Sep 24, 2024
98e8f46
Merge branch 'facebook:main' into main
matt-lzy Oct 8, 2024
180e660
Merge branch 'facebook:main' into main
matt-lzy Oct 14, 2024
51d7703
Merge branch 'facebook:main' into main
matt-lzy Oct 24, 2024
d643747
Merge branch 'facebook:main' into main
matt-lzy Oct 30, 2024
c7b6abc
Merge branch 'facebook:main' into main
matt-lzy Nov 4, 2024
aba7ab3
Merge branch 'facebook:main' into main
matt-lzy Nov 11, 2024
84b6641
Merge branch 'facebook:main' into main
matt-lzy Nov 12, 2024
793f6de
Merge branch 'facebook:main' into main
matt-lzy Nov 18, 2024
f53e6fb
Merge branch 'facebook:main' into main
matt-lzy Nov 20, 2024
9d1c3f3
Merge branch 'facebook:main' into main
matt-lzy Nov 26, 2024
58de7dc
Merge branch 'facebook:main' into main
matt-lzy Dec 5, 2024
708f398
Merge branch 'facebook:main' into main
matt-lzy Jan 7, 2025
a85bc17
Merge branch 'facebook:main' into main
matt-lzy Apr 7, 2025
749c4a5
Merge branch 'facebook:main' into main
matt-lzy Apr 29, 2025
eae9e9c
Merge branch 'facebook:main' into main
matt-lzy May 6, 2025
0515181
Merge branch 'facebook:main' into main
matt-lzy May 14, 2025
0658f7a
Merge branch 'facebook:main' into main
matt-lzy May 21, 2025
1516c56
Merge branch 'facebook:main' into main
matt-lzy Jun 3, 2025
0e78498
Merge branch 'facebook:main' into main
matt-lzy Jun 17, 2025
840419c
Merge branch 'facebook:main' into main
matt-lzy Jul 1, 2025
0060165
Merge branch 'facebook:main' into main
matt-lzy Jul 4, 2025
5639a0a
Merge branch 'facebook:main' into main
matt-lzy Jul 9, 2025
443d67c
Merge branch 'facebook:main' into main
matt-lzy Jul 18, 2025
6d9490f
Merge branch 'facebook:main' into main
matt-lzy Oct 3, 2025
964afe4
Merge branch 'facebook:main' into main
matt-lzy Nov 25, 2025
8cba061
Merge branch 'facebook:main' into main
matt-lzy Dec 10, 2025
2fcef31
Merge branch 'facebook:main' into main
matt-lzy Dec 11, 2025
af4a9e6
adjust semiauto param scale and fix leak led status
matt-lzy Dec 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions meta-facebook/aalc-rpu/src/platform/plat_fsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern pid_cfg pump_pid_table[];
extern stepwise_cfg pump_stepwise_auto_mode_table[];
extern stepwise_cfg pump_stepwise_auto_tune_table[];

static uint8_t setpoint[SETPOINT_FLAG_MAX] = { 0, 40 };
static float setpoint[SETPOINT_FLAG_MAX] = { 0, 40.0 };

uint8_t fsc_debug_set(uint8_t enable)
{
Expand Down Expand Up @@ -75,14 +75,14 @@ void set_fsc_tbl_enable(uint8_t flag)
fsc_tbl_enable = flag;
}

uint8_t get_fsc_setpoint(uint8_t idx)
float get_fsc_setpoint(uint8_t idx)
{
if (idx >= SETPOINT_FLAG_MAX) {
return 0xFF;
}
return setpoint[idx];
}
void set_fsc_setpoint(uint8_t idx, uint8_t val)
void set_fsc_setpoint(uint8_t idx, float val)
{
if (idx < SETPOINT_FLAG_MAX) {
setpoint[idx] = val;
Expand Down Expand Up @@ -188,7 +188,7 @@ static uint8_t calculatePID(zone_cfg *zone_p, uint8_t *duty)
(int16_t)tmp :
tmp;

FSC_PRINTF("\t\t----- sensor_num %x, temp = %f, p->setpoint %d\n", p->sensor_num,
FSC_PRINTF("\t\t----- sensor_num %x, temp = %f, p->setpoint %f\n", p->sensor_num,
temp, p->setpoint);

// hysteresis
Expand All @@ -204,7 +204,7 @@ static uint8_t calculatePID(zone_cfg *zone_p, uint8_t *duty)
}

// p term
float error = (float)p->setpoint - temp;
float error = p->setpoint - temp;
float pterm = p->kp * error;
FSC_PRINTF("\t\t\tp->kp = %f, error = %f, pterm = %f\n", p->kp, error, pterm);

Expand Down Expand Up @@ -293,7 +293,7 @@ void change_lpm_setpoint(uint8_t onoff)
{
if (onoff) {
zone_table[1].pid_tbl = pump_pid_table;
zone_table[1].pid_tbl->setpoint = get_fsc_setpoint(SETPOINT_FLAG_LPM) + 1;
zone_table[1].pid_tbl->setpoint = get_fsc_setpoint(SETPOINT_FLAG_LPM) + 1.0;
zone_table[1].sw_tbl = pump_stepwise_auto_tune_table;
} else {
if (zone_table[1].pid_tbl) {
Expand All @@ -311,7 +311,8 @@ void change_temp_setpoint(uint8_t onoff)
zone_table[0].pid_tbl->integral = 0.0;
zone_table[0].pid_tbl->last_error = 0.0;
zone_table[0].pid_tbl->last_temp = FSC_TEMP_INVALID;
zone_table[0].pid_tbl->setpoint = onoff ? get_fsc_setpoint(SETPOINT_FLAG_OUTLET_TEMP) : 40;
zone_table[0].pid_tbl->setpoint =
onoff ? get_fsc_setpoint(SETPOINT_FLAG_OUTLET_TEMP) : 40.0;
}

/**
Expand Down Expand Up @@ -417,4 +418,4 @@ void fsc_init(void)
fsc_thread_handler, zone_table, UINT_TO_POINTER(zone_table_size), NULL,
CONFIG_MAIN_THREAD_PRIORITY, 0, K_NO_WAIT);
k_thread_name_set(&fsc_thread, "fsc_thread");
}
}
6 changes: 3 additions & 3 deletions meta-facebook/aalc-rpu/src/platform/plat_fsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ typedef struct {
/* pid */
typedef struct {
uint8_t sensor_num;
int setpoint;
float setpoint;
/*uint8_t setpoint_type;*/
float kp;
float ki;
Expand Down Expand Up @@ -123,8 +123,8 @@ void fsc_init(void);
void controlFSC(uint8_t action);
uint8_t fsc_debug_set(uint8_t enable);
uint8_t fsc_debug_get(void);
uint8_t get_fsc_setpoint(uint8_t idx);
void set_fsc_setpoint(uint8_t idx, uint8_t val);
float get_fsc_setpoint(uint8_t idx);
void set_fsc_setpoint(uint8_t idx, float val);
void change_lpm_setpoint(uint8_t onoff);
void change_temp_setpoint(uint8_t onoff);

Expand Down
6 changes: 3 additions & 3 deletions meta-facebook/aalc-rpu/src/platform/plat_fsc_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
pid_cfg hex_fan_pid_table[] = {
{
.sensor_num = SENSOR_NUM_BPB_RPU_COOLANT_OUTLET_TEMP_C,
.setpoint = 40,
.setpoint = 40.0,
.kp = -15,
.ki = -0.1,
.kd = -0.01,
Expand Down Expand Up @@ -67,7 +67,7 @@ stepwise_cfg hex_fan_stepwise_table[] = {
pid_cfg pump_pid_table[] = {
{
.sensor_num = SENSOR_NUM_BPB_RPU_COOLANT_FLOW_RATE_LPM,
.setpoint = 40,
.setpoint = 40.0,
.kp = 0.5,
.ki = 0.03,
.kd = 0.01,
Expand Down Expand Up @@ -157,4 +157,4 @@ zone_cfg zone_table[] = {
},
};

uint32_t zone_table_size = ARRAY_SIZE(zone_table);
uint32_t zone_table_size = ARRAY_SIZE(zone_table);
12 changes: 9 additions & 3 deletions meta-facebook/aalc-rpu/src/platform/plat_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,19 @@ void pump_redundant_handler_disable(struct k_timer *timer)
}
K_TIMER_DEFINE(pump_redundant_timer, pump_redundant_handler, pump_redundant_handler_disable);

static uint8_t pump_redundant_switch_time = 30;
static uint16_t pump_redundant_switch_time = 30;
static uint8_t pump_redundant_switch_time_type = 0; /* for test, 0: day, 1: minute */
uint8_t get_pump_redundant_switch_time()

uint16_t get_pump_redundant_switch_time()
{
return pump_redundant_switch_time;
}
void set_pump_redundant_switch_time(uint8_t time)
uint8_t get_pump_redundant_switch_time_type()
{
return pump_redundant_switch_time_type;
}

void set_pump_redundant_switch_time(uint16_t time)
{
pump_redundant_switch_time = time;
}
Expand Down
5 changes: 3 additions & 2 deletions meta-facebook/aalc-rpu/src/platform/plat_hwmon.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ bool pump_setting_set_pump_redundant(pump_reset_struct *data, uint8_t bit_val);
bool modbus_pump_setting_unsupport_function(pump_reset_struct *data, uint8_t bit_val);
bool set_all_pump_power(bool switch_val);
bool rpu_remote_power_cycle_function(pump_reset_struct *data, uint8_t bit_val);
uint8_t get_pump_redundant_switch_time();
void set_pump_redundant_switch_time(uint8_t time);
uint16_t get_pump_redundant_switch_time();
uint8_t get_pump_redundant_switch_time_type();
void set_pump_redundant_switch_time(uint16_t time);
void set_pump_redundant_switch_time_type(uint8_t type);
void pump_redundant_enable(uint8_t onoff);
uint8_t pwm_control(uint8_t group, uint8_t duty);
Expand Down
40 changes: 34 additions & 6 deletions meta-facebook/aalc-rpu/src/platform/plat_modbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ uint8_t modbus_pump_setting(modbus_command_mapping *cmd)
set_is_pump_not_access(1, false);
set_is_pump_not_access(2, false);
// restore leak led
led_ctrl(LED_IDX_E_LEAK, LED_STOP_BLINK);
led_ctrl(LED_IDX_E_LEAK, LED_STOP_BLINK); // only stop blind behavior
led_ctrl(LED_IDX_E_LEAK, LED_TURN_OFF); // default led status(turn off)
set_status_flag(STATUS_FLAG_FAILURE, GPIO_FAIL_BPB_HSC, 0);
for (uint8_t i = PUMP_FAIL_EMERGENCY_BUTTON; i <= PUMP_FAIL_CLOSE_PUMP; i++) {
set_status_flag(STATUS_FLAG_FAILURE, i, 0);
Expand Down Expand Up @@ -743,17 +744,17 @@ uint8_t modbus_get_setpoint(modbus_command_mapping *cmd)
{
CHECK_NULL_ARG_WITH_RETURN(cmd, MODBUS_EXC_ILLEGAL_DATA_VAL);

cmd->data[0] = get_fsc_setpoint(cmd->arg0);
cmd->data[0] = (uint16_t)(get_fsc_setpoint(cmd->arg0) / cmd->arg1 / pow_of_10(cmd->arg2));

return MODBUS_EXC_NONE;
}
uint8_t modbus_set_setpoint(modbus_command_mapping *cmd)
{
CHECK_NULL_ARG_WITH_RETURN(cmd, MODBUS_EXC_ILLEGAL_DATA_VAL);

set_fsc_setpoint(cmd->arg0, (uint8_t)cmd->data[0]);
set_fsc_setpoint(cmd->arg0, (float)cmd->data[0] * cmd->arg1 * pow_of_10(cmd->arg2));
uint8_t idx = cmd->arg0;
set_fsc_setpoint(idx, (uint8_t)cmd->data[0]);
set_fsc_setpoint(idx, (float)cmd->data[0] * cmd->arg1 * pow_of_10(cmd->arg2));
if ((get_status_flag(STATUS_FLAG_SETPOINT_FLAG) && BIT(idx))) {
switch (idx) {
case SETPOINT_FLAG_LPM:
Expand Down Expand Up @@ -801,6 +802,31 @@ uint8_t modbus_set_setpoint_enable(modbus_command_mapping *cmd)
return MODBUS_EXC_NONE;
}

uint8_t modbus_get_pump_redundant_switch_day(modbus_command_mapping *cmd)
{
CHECK_NULL_ARG_WITH_RETURN(cmd, MODBUS_EXC_ILLEGAL_DATA_VAL);

if (get_pump_redundant_switch_time_type())
cmd->data[0] = (uint16_t)((double)get_pump_redundant_switch_time() / 1440.0 + 0.5);
else
cmd->data[0] = get_pump_redundant_switch_time();

return MODBUS_EXC_NONE;
}
uint8_t modbus_set_pump_redundant_switch_day(modbus_command_mapping *cmd)
{
CHECK_NULL_ARG_WITH_RETURN(cmd, MODBUS_EXC_ILLEGAL_DATA_VAL);

if (!cmd->data[0])
return MODBUS_EXC_ILLEGAL_DATA_VAL;
else {
set_pump_redundant_switch_time_type(0);
set_pump_redundant_switch_time(cmd->data[0]);
}

return MODBUS_EXC_NONE;
}

uint8_t modbus_get_board_stage(modbus_command_mapping *cmd)
{
CHECK_NULL_ARG_WITH_RETURN(cmd, MODBUS_EXC_ILLEGAL_DATA_VAL);
Expand Down Expand Up @@ -1376,9 +1402,11 @@ modbus_command_mapping modbus_command_table[] = {
modbus_get_setpoint_enable, SETPOINT_FLAG_OUTLET_TEMP, 0, 0, 1 },
// Control
{ MODBUS_AUTO_TUNE_COOLANT_FLOW_RATE_TARGET_SET_ADDR, modbus_set_setpoint,
modbus_get_setpoint, SETPOINT_FLAG_LPM, 0, 0, 1 },
modbus_get_setpoint, SETPOINT_FLAG_LPM, 1, -1, 1 },
{ MODBUS_AUTO_TUNE_COOLANT_OUTLET_TEMPERATURE_TARGET_SET_ADDR, modbus_set_setpoint,
modbus_get_setpoint, SETPOINT_FLAG_OUTLET_TEMP, 0, 0, 1 },
modbus_get_setpoint, SETPOINT_FLAG_OUTLET_TEMP, 1, -1, 1 },
{ MODBUS_PUMP_REDUNDANT_SWITCHED_INTERVAL_ADDR, modbus_set_pump_redundant_switch_day,
modbus_get_pump_redundant_switch_day, SETPOINT_FLAG_LPM, 0, 0, 1 },
{ MODBUS_MANUAL_CONTROL_PUMP_DUTY_SET_ADDR, modbus_set_manual_pwm, modbus_get_manual_pwm,
MANUAL_PWM_E_PUMP, 0, 0, 1 },
{ MODBUS_MANUAL_CONTROL_FAN_DUTY_SET_ADDR, modbus_set_manual_pwm, modbus_get_manual_pwm,
Expand Down
6 changes: 5 additions & 1 deletion meta-facebook/aalc-rpu/src/platform/plat_pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,11 @@ uint8_t ctl_pwm_pump(uint8_t pump1_duty, uint8_t pump2_duty, uint8_t pump3_duty)
(redundant_mode == PUMP_REDUNDANT_13) ? PWM_DEVICE_E_PB_PUMB_2 :
(redundant_mode == PUMP_REDUNDANT_23) ? PWM_DEVICE_E_PB_PUMB_1 :
PWM_DEVICE_E_MAX;
if (redundant_dev != PWM_DEVICE_E_MAX && redundant_dev_pre != redundant_dev) {

if (!get_is_redundant_transforming())
redundant_dev_now = redundant_dev;

if (redundant_dev_now != PWM_DEVICE_E_MAX && redundant_dev_pre != redundant_dev_now) {
switch (redundant_phase) {
case REDUNDANCY_TRANSFORM_DISABLE:
if (redundant_dev_pre != PWM_DEVICE_E_MAX) {
Expand Down
2 changes: 1 addition & 1 deletion meta-facebook/aalc-rpu/src/platform/plat_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ static void cmd_pump_redundant_enable(const struct shell *shell, size_t argc, ch
static void cmd_pump_redundant_switch_day_set(const struct shell *shell, size_t argc, char **argv)
{
uint8_t type = strtoul(argv[1], NULL, 10);
uint8_t time = strtoul(argv[2], NULL, 10);
uint16_t time = strtoul(argv[2], NULL, 10);

set_pump_redundant_switch_time_type(type);
set_pump_redundant_switch_time(time);
Expand Down