File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -741,21 +741,28 @@ bool tu_fifo_write(tu_fifo_t* f, const void * data)
741
741
{
742
742
_ff_lock (f -> mutex_wr );
743
743
744
- uint16_t w = f -> wr_idx ;
744
+ bool ret ;
745
+ uint16_t const w = f -> wr_idx ;
745
746
746
- if ( _tu_fifo_full (f , w , f -> rd_idx ) && !f -> overwritable ) return false;
747
+ if ( _tu_fifo_full (f , w , f -> rd_idx ) && !f -> overwritable )
748
+ {
749
+ ret = false;
750
+ }else
751
+ {
752
+ uint16_t wRel = get_relative_pointer (f , w );
747
753
748
- uint16_t wRel = get_relative_pointer (f , w );
754
+ // Write data
755
+ _ff_push (f , data , wRel );
749
756
750
- // Write data
751
- _ff_push (f , data , wRel );
757
+ // Advance pointer
758
+ f -> wr_idx = advance_pointer (f , w , 1 );
752
759
753
- // Advance pointer
754
- f -> wr_idx = advance_pointer ( f , w , 1 );
760
+ ret = true;
761
+ }
755
762
756
763
_ff_unlock (f -> mutex_wr );
757
764
758
- return true ;
765
+ return ret ;
759
766
}
760
767
761
768
/******************************************************************************/
You can’t perform that action at this time.
0 commit comments