Closed SteveCEvans closed 1 month ago
Do you want to test this code? You can flash it directly from Betaflight Configurator:
#13562
(this pull request number) in the Select commit
field of the Configurator firmware flasher tab (you need to Enable expert mode
, Show release candidates
and Development
).WARNING: It may be unstable. Use only for testing!
can you merge upstream/master, please? it should remove conflicts
went fly this (5cdae1b
) on non-affected target. figured it was the least i could do after effing up. logs were in-tact for APEXF7 W25Q128FV.
@SteveCEvans , this branch has merge conflicts. merging master (or rebase) will fix.
commit 6837ed2 needs closing #endif
's
commit 6837ed2 needs closing
#endif
's
Yup, rather daft copy-n-paste error!
@ledvinap please test
@SteveCEvans :
Both gcc and clang support initialization of structure flexible member. With it, segments can be refactored, removing union and making code cleaner overall. dev
will point to current segments, linking and skipping will be easier, it will save some memory.
I'd also pass segment index and busSegment_t* to callback (making it common for whole chain) and add flags to each buffers[] entry(skip, possibly last, etc), but that is personal preference ...
typedef struct busSegment_s {
struct {
// device associated with THIS transfer
const extDevice_t *dev;
// Segments to process in the next transfer.
volatile struct busSegment_s *next;
int segmentcount; // number of segments in this block
} head;
struct {
// Transmit buffer
uint8_t *txData;
// Receive buffer, or in the case of the final segment to
uint8_t *rxData;
int len;
bool negateCS; // Should CS be negated at the end of this segment
busStatus_e (*callback)(uint32_t arg);
} buffers[];
} busSegment_t;
Follow on from https://github.com/betaflight/betaflight/pull/13555