1010
1111FAST_RAM target_t target = {
1212 .name = "unknown" ,
13- .brushless = true,
1413};
1514
1615#define _MACRO_STR (arg ) #arg
@@ -267,19 +266,25 @@ cbor_result_t cbor_encode_output_caps_t(cbor_value_t *enc, const output_caps_t *
267266 cbor_result_t res = CBOR_OK ;
268267
269268 uint32_t count = 0 ;
270- if (* t & OUTPUT_CAP_MOTOR ) {
269+ if (* t & OUTPUT_CAP_PWM ) {
271270 count ++ ;
272271 }
273- if (* t & OUTPUT_CAP_SERVO ) {
272+ if (* t & OUTPUT_CAP_DSHOT ) {
273+ count ++ ;
274+ }
275+ if (* t & OUTPUT_CAP_BRUSHED ) {
274276 count ++ ;
275277 }
276278
277279 CBOR_CHECK_ERROR (res = cbor_encode_array (enc , count ));
278- if (* t & OUTPUT_CAP_MOTOR ) {
279- CBOR_CHECK_ERROR (res = cbor_encode_str (enc , "motor" ));
280+ if (* t & OUTPUT_CAP_PWM ) {
281+ CBOR_CHECK_ERROR (res = cbor_encode_str (enc , "pwm" ));
282+ }
283+ if (* t & OUTPUT_CAP_DSHOT ) {
284+ CBOR_CHECK_ERROR (res = cbor_encode_str (enc , "dshot" ));
280285 }
281- if (* t & OUTPUT_CAP_SERVO ) {
282- CBOR_CHECK_ERROR (res = cbor_encode_str (enc , "servo " ));
286+ if (* t & OUTPUT_CAP_BRUSHED ) {
287+ CBOR_CHECK_ERROR (res = cbor_encode_str (enc , "brushed " ));
283288 }
284289
285290 return res ;
@@ -296,10 +301,12 @@ cbor_result_t cbor_decode_output_caps_t(cbor_value_t *dec, output_caps_t *t) {
296301 const uint8_t * name ;
297302 uint32_t name_len ;
298303 CBOR_CHECK_ERROR (res = cbor_decode_tstr (dec , & name , & name_len ));
299- if (buf_equal_string (name , name_len , "motor" )) {
300- caps |= OUTPUT_CAP_MOTOR ;
301- } else if (buf_equal_string (name , name_len , "servo" )) {
302- caps |= OUTPUT_CAP_SERVO ;
304+ if (buf_equal_string (name , name_len , "pwm" )) {
305+ caps |= OUTPUT_CAP_PWM ;
306+ } else if (buf_equal_string (name , name_len , "dshot" )) {
307+ caps |= OUTPUT_CAP_DSHOT ;
308+ } else if (buf_equal_string (name , name_len , "brushed" )) {
309+ caps |= OUTPUT_CAP_BRUSHED ;
303310 }
304311 }
305312
0 commit comments