FW: bug in _dtoa_r
"David Eicher" <[email protected]>
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
_____ From: David Eicher [mailto:[email protected]] Sent: Tuesday, August 30, 2005 7:16 PM To: '[email protected]' Subject: bug in _dtoa_r Hello, I'm not sure, but there may be a bug in the subject routine. My printf is hanging in this routine if I put a float in the printf statement below. Where I'm printing %10i, if I change that to %10f and pass in valuea instead of ivaluea, she hangs. Thoughts? Thanks, Dave void analogreader(long chan) { int i; UWord16 ivaluea, ivalueb; float valuea,valueb; static char *pin_table_a[] = { "VBAT ", "VIGN ", "P2-17", "P2-18","P2-19", "P2-20", "P2-21", "P2-22", "P2-23", "P2-12", "NA", "NA","NA", "NA", "NA", "NA"}; static char *pin_table_b[] = { "P2-7,8 (NB O2)", "P2-18,19 (NB O2)", "P2-29", "P2-29","P2-30", "P2-31", "P2-32", "P2-33", "P2-34", "P2-35", "NA", "NA","NA", "NA", "NA", "NA"}; printf("\n\r\n\r%s\n\r", "---------------------------------------------------------"); if (chan == 1) { /* Initialize QADC: */ /* -Use module A */ /* -Use channel 0-15 as input */ ioctl( QADC_A, QADC_INIT, NULL ); printf("QADC_A Analog Values: (Press any key to quit)\n\r"); } else { /* Initialize QADC: */ /* -Use module B */ /* -Use channel 0-15 as input */ ioctl( QADC_B, QADC_INIT, NULL ); printf("QADC_B Analog Values: (Press any key to quit)\n\r"); } delay(500000); printf("%s\n\r", "---------------------------------------------------------"); printf("Chan # Voltage Pin Chan # Voltage Pin\n\r"); printf("%s\n\r", "---------------------------------------------------------"); do { for(i=0; i<8; i++) { if (chan == 1) { ivaluea = ioctl(QADC_A, QADC_READ_RJU_RESULT, i); ivaluea = ivaluea*5; valuea = ivaluea * 5/1024; ivalueb = ioctl(QADC_A, QADC_READ_RJU_RESULT, i+8); valueb = ivalueb * 5/1024; -- hangs here --> printf("%4i%10i %-16s |%4i%10i %s\n\r",i,ivaluea,pin_table_a[i],i+8,ivalueb,pin_table_a[i+8]); } else { ivaluea = ioctl(QADC_B, QADC_READ_RJU_RESULT, i); ivalueb = ioctl(QADC_B, QADC_READ_RJU_RESULT, i+8); printf("%4i%10i %-16s |%4i%10i %s\n\r",i,ivaluea,pin_table_b[i],i+8,ivalueb,pin_table_b[i+8]); } delay(100000); } /* VT100 ESC code sequence: cursor up 8 lines. */ printf("\r\033[8A"); } while (!(ioctl(QSMCM_SCI1, SCI_GET_FLAGS, SCI_RX_FULL))); printf("\r\033[8B"); ioctl(QADC_A, QADC_QUEUE_2_SET_MODE, QADC_DISABLED); } [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/dN_tlB/TM --------------------------------------------------------------------~-> ----------------------------------------------------------- To learn more about Freescale Microcontrollers, please visit http://www.freescale.com/mcu Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/MPC500/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/