Project

General

Profile

Revision 1547

Added by Brad Neuman over 14 years ago

found one bug and changed some debug prints

View differences:

bom.c
151 151
		analog_pin = MONKI;
152 152
        break;
153 153
    case BOM15:
154
        //Sets BOM1.5 to normal [BOM] mode
155
        digital_output(BOM_MODE, 0);
156
		select_pins[0] = BOM_S0; 
157
		select_pins[1] = BOM_S1;
158
		select_pins[2] = BOM_S2;
159
		select_pins[3] = BOM_S3;
160
		bom_set_leds(BOM_ALL);
161
		analog_pin = BOM_OUT;
162
        break;
154
      //Sets BOM1.5 to normal [BOM] mode
155
      digital_output(BOM_MODE, 0);
156
      select_pins[0] = BOM_S0; 
157
      select_pins[1] = BOM_S1;
158
      select_pins[2] = BOM_S2;
159
      select_pins[3] = BOM_S3;
160
      bom_set_leds(BOM_ALL);
161
      analog_pin = BOM_OUT;
162
      break;
163 163
    case RBOM:
164
      DRAGONFLY_DEBUG_PRINT("RBOM is not currently supported\r\n");
164 165
        break;
165 166
    default:
166 167
      DRAGONFLY_DEBUG_PRINT("ERROR: unknown BOM type ");
......
336 337
    int i;
337 338
    unsigned int mask = 1<<(NUM_BOM_LEDS-1);
338 339

  
339
    if(!bom_initd) {
340
      DRAGONFLY_DEBUG_PRINT("ERROR: BOM not init'd\r\n");
341
      return ERROR_LIBRARY_NOT_INITD;
342
    }
343

  
344 340
    switch(bom_type) {
345 341
    case BOM10:
346
        //TODO: put an assert here to alert the user that this should not be called
347
        break;
342
      DRAGONFLY_DEBUG_PRINT("ERROR: bom_set_leds called with a BOM 1.0. This doesn't make sense\r\n");
343
      break;
348 344
		
349 345
    case BOM15:
350
	    for(i=NUM_BOM_LEDS; i>0; i--)
351
	    {
352
		    //set the current bit, sending MSB first
353
		    digital_output(BOM_DATA, bit_field&mask);
354
		    //then pulse the clock
355
		    digital_output(BOM_CLOCK, 1);
356
		    digital_output(BOM_CLOCK, 0);
357
			mask = mask>>1;
358
	    }
359
        break;
346
      for(i=NUM_BOM_LEDS; i>0; i--)
347
      {
348
	//set the current bit, sending MSB first
349
	digital_output(BOM_DATA, bit_field&mask);
350
	//then pulse the clock
351
	digital_output(BOM_CLOCK, 1);
352
	digital_output(BOM_CLOCK, 0);
353
	mask = mask>>1;
354
      }
355
      break;
360 356
		
361 357
    case RBOM:
362
        //add rbom code here
363
        break;
358
      //add rbom code here
359
      break;
364 360
    }
365 361

  
366 362
    return 0;
......
406 402
	break;
407 403
  case BOM15:
408 404
	digital_output(BOM_STROBE, 1);
405
	DRAGONFLY_DEBUG_PRINT("BOM should be on?\r\n");
409 406
	break;
410 407
  case RBOM:
411 408
	break;

Also available in: Unified diff