45 #ifdef CONF_DMOTOR_HOLD
46 const unsigned char dm_a_pattern[]={0xc0,0x40,0x80,0x00},
50 const unsigned char dm_a_pattern[]={0x00,0x80,0x40,0xc0},
69 extern void dm_handler(
void);
70 #ifndef DOXYGEN_SHOULD_SKIP_THIS
74 .global _dm_handler\n\
77 ; r0 saved by systime_handler\n\
79 #ifdef CONF_DMOTOR_HOLD
80 " mov.b #0xcf,r6l ; r6l is output\n"
82 " sub.w r6,r6 ; r6l is output\n"
84 " ; we simultaneously load delta (r0h) and sum (r0l)\n\
85 ; this depends on byte order, but the H8 will stay MSB\n\
86 ; and the resulting code is efficient and compact.\n\
91 add.b #1,r0h ; maps 255 to 256\n\
93 addx.b r0h,r0l ; add delta to sum\n\
94 bcc dm0 ; sum overflow?\n\
95 mov.b @_dm_a+2,r6h ; -> output drive pattern\n\
97 dm0:mov.b r0l,@_dm_a+1 ; save sum\n\
102 add.b #1,r0h ; maps 255 to 256\n\
104 addx.b r0h,r0l ; add delta to sum\n\
105 bcc dm1 ; sum overflow?\n\
106 mov.b @_dm_b+2,r6h ; -> output drive pattern\n\
108 dm1:mov.b r0l,@_dm_b+1 ; save sum\n\
113 add.b #1,r0h ; maps 255 to 256\n\
115 addx.b r0h,r0l ; add delta to sum\n\
116 bcc dm2 ; sum overflow?\n\
117 mov.b @_dm_c+2,r6h ; -> output drive pattern\n\
119 dm2:mov.b r0l,@_dm_c+1 ; save sum\n\
123 mov.b r6l,@_motor_controller:8 ; output motor waveform\n\
127 #endif // DOXYGEN_SHOULD_SKIP_THIS
189 #endif // ifdef CONF_VIS
191 #endif // CONF_DMOTOR