Jelajahi Sumber

Elide fsensor_st_block_begin, saving some cycles/bytes

Yuri D'Elia 5 tahun lalu
induk
melakukan
d2432056bd
2 mengubah file dengan 6 tambahan dan 10 penghapusan
  1. 0 9
      Firmware/fsensor.cpp
  2. 6 1
      Firmware/fsensor.h

+ 0 - 9
Firmware/fsensor.cpp

@@ -489,15 +489,6 @@ void fsensor_setup_interrupt(void)
 
 #endif //PAT9125
 
-void fsensor_st_block_begin(bool rev __attribute__((unused)))
-{
-    // There's really nothing to do here: the stepper ISR likely has called us
-    // already at the end of the last block, making this integration redundant.
-    // LA1.5 might not always do that during a coasting move, so attempt to drain
-    // fsensor_st_cnt anyway at the beginning of the new block.
-    fsensor_st_block_chunk(0);
-}
-
 void fsensor_st_block_chunk(int cnt)
 {
 	if (!fsensor_enabled) return;

+ 6 - 1
Firmware/fsensor.h

@@ -58,8 +58,13 @@ extern bool fsensor_oq_result(void);
 
 //! @name callbacks from stepper
 //! @{
-extern void fsensor_st_block_begin(bool rev);
 extern void fsensor_st_block_chunk(int cnt);
+
+// There's really nothing to do in block_begin: the stepper ISR likely has
+// called us already at the end of the last block, making this integration
+// redundant. LA1.5 might not always do that during a coasting move, so attempt
+// to drain fsensor_st_cnt anyway at the beginning of the new block.
+#define fsensor_st_block_begin(rev) fsensor_st_block_chunk(0)
 //! @}
 
 #endif //FSENSOR_H