ソースを参照

Save 8 bytes of SRAM

Scott Lahteine 8年前
コミット
51bc50214a
1個のファイルの変更2行の追加2行の削除
  1. 2
    2
      Marlin/stepper_dac.cpp

+ 2
- 2
Marlin/stepper_dac.cpp ファイルの表示

49
 
49
 
50
   bool dac_present = false;
50
   bool dac_present = false;
51
   const uint8_t dac_order[NUM_AXIS] = DAC_STEPPER_ORDER;
51
   const uint8_t dac_order[NUM_AXIS] = DAC_STEPPER_ORDER;
52
-  uint16_t dac_channel_pct[XYZE] = DAC_MOTOR_CURRENT_DEFAULT;
52
+  uint8_t dac_channel_pct[XYZE] = DAC_MOTOR_CURRENT_DEFAULT;
53
 
53
 
54
   int dac_init() {
54
   int dac_init() {
55
     #if PIN_EXISTS(DAC_DISABLE)
55
     #if PIN_EXISTS(DAC_DISABLE)
95
   static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * (1.0 / (DAC_STEPPER_SENSE)); }
95
   static float dac_amps(int8_t n) { return mcp4728_getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * (1.0 / (DAC_STEPPER_SENSE)); }
96
 
96
 
97
   int16_t dac_current_get_percent(AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); }
97
   int16_t dac_current_get_percent(AxisEnum axis) { return mcp4728_getDrvPct(dac_order[axis]); }
98
-  void dac_current_set_percents(int16_t pct[XYZE]) {
98
+  void dac_current_set_percents(const int8_t pct[XYZE]) {
99
     LOOP_XYZE(i) dac_channel_pct[i] = pct[dac_order[i]];
99
     LOOP_XYZE(i) dac_channel_pct[i] = pct[dac_order[i]];
100
     mcp4728_setDrvPct(dac_channel_pct);
100
     mcp4728_setDrvPct(dac_channel_pct);
101
   }
101
   }

読み込み中…
キャンセル
保存