#include <stdint.h>
#include <stdlib.h>
-#define LED0 BIT0 /* P1.0 */
-#define CLKP BIT1 /* P1.1 */
-#define CLKN BIT2 /* P1.2 */
+//#define LED0 BIT0 /* P1.0 */
+#define CLKP BIT6 /* P1.6 */
+#define CLKN BIT7 /* P1.7 */
static void
-init_leds(void)
+setup(void)
{
//P1DIR |= LED0 | CLKP | CLKN; /* set P1.0,P1.1,P1.2 as output */
//P1OUT |= LED0 | CLKP | CLKN; /* set P1.0,P1.1,P1.2 low */
P1DIR = 0xff; /* set P1.* to output for reduced power consumption */
- P1OUT = LED0 | CLKP | CLKN;
+ P1OUT = CLKP | CLKN;
/* set the counter to match on 511 which is 1s for 32kHz/8/8 (timer
* re-divides the interrupt clock by 8 */
BCSCTL3 |= XCAP_3; /* enable 12.5pF internal capacitance */
srand(0xf00d);
- init_leds();
+ setup();
/* enable global interrupts */
eint();
/* if driving the stepper coil, stop after 32ms (1 interrupt) */
if (state == State_Driving) {
state = State_Wait;
- P1OUT &= ~(CLKP | CLKN | LED0);
+ P1OUT &= ~(CLKP | CLKN);
}
if (count == 32) {
--offset;
if (offset == 0) {
state = State_Driving;
- P1OUT |= pin_pos | LED0;
+ P1OUT |= pin_pos;
P1OUT &= ~pin_neg;
/* swap the pins for the next tick */
uint8_t t = pin_pos;