@@ -519,7 +519,7 @@ uint16_t jsd_egd_tlc_to_do(char tlc[2]) {
519
519
520
520
if (index < 0x3000 || index > 0x3FFF ) {
521
521
ERROR (
522
- "Two-Letter Command converstion is out of range: %s -> 0x%X not in "
522
+ "Two-Letter Command conversion is out of range: %s -> 0x%X not in "
523
523
"(0x3000,0x3FFF)" ,
524
524
tlc , index );
525
525
}
@@ -836,6 +836,14 @@ int jsd_egd_config_TLC_params(ecx_contextt* ecx_context, uint16_t slave_id,
836
836
837
837
// PL[1] does not need to be set here since it is updated synchronously
838
838
// with every PDO exchange
839
+ // Let's set it anyways to help head off any potential issues. Setting the
840
+ // PDO-mapped max current doesn't appear to update PL[1]
841
+ if (!jsd_sdo_set_param_blocking (
842
+ ecx_context , slave_id , jsd_egd_tlc_to_do ("PL" ), 1 , JSD_SDO_DATA_FLOAT ,
843
+ (void * )& config -> egd .peak_current_limit )) {
844
+ return 0 ;
845
+ }
846
+
839
847
840
848
if (!jsd_sdo_set_param_blocking (
841
849
ecx_context , slave_id , jsd_egd_tlc_to_do ("CL" ), 1 , JSD_SDO_DATA_FLOAT ,
@@ -944,6 +952,14 @@ int jsd_egd_config_TLC_params(ecx_contextt* ecx_context, uint16_t slave_id,
944
952
return 0 ;
945
953
}
946
954
955
+ int32_t um = 0 ;
956
+ if (!jsd_sdo_get_param_blocking (
957
+ ecx_context , slave_id , jsd_egd_tlc_to_do ("UM" ), 1 , JSD_SDO_DATA_U32 ,
958
+ (void * )& um )) {
959
+ return 0 ;
960
+ }
961
+ MSG ("EGD[%d] UM[1] = %d" , slave_id , um );
962
+
947
963
return 1 ;
948
964
}
949
965
@@ -1001,10 +1017,21 @@ void jsd_egd_async_sdo_process(jsd_t* self, uint16_t slave_id) {
1001
1017
if (!req .success ) {
1002
1018
ERROR ("Slave[%u] Failed last SDO operation on 0x%X:%u, wkc = %d" ,
1003
1019
slave_id , req .sdo_index , req .sdo_subindex , req .wkc );
1020
+ }else {
1021
+
1022
+ // NOTE: If there is a usecase for low-frequency SDO
1023
+ // Reads, EGD could parse SDO Read requests
1024
+ // and update public state data here
1025
+
1026
+ if (req .sdo_index == jsd_egd_tlc_to_do ("UM" )){
1027
+ MSG ("EGD[%d] UM[%d] = %d (0x%X:%d set through async SDO)" ,
1028
+ slave_id ,
1029
+ req .sdo_subindex ,
1030
+ req .data .as_i32 ,
1031
+ req .sdo_index ,
1032
+ req .sdo_subindex );
1033
+ }
1004
1034
}
1005
- // NOTE: If there is a usecase for low-frequency SDO
1006
- // Reads, EGD could parse SDO Read requests
1007
- // and update public state data here
1008
1035
}
1009
1036
1010
1037
// 2) Check if any SDO operations are ongoing and update state
0 commit comments