Hello...
Here is a "section" of code that doesn't seem to stop on the while(i2cstate......) loop piece. The code blows right through.....Watching bus transactions the RGB section all data looks good, however on the LCD section I get all zeroes on the data transaction which signals to me the pointer didn't get reset which in turn looks like I never get into the ISR.I2CComplete section...I have tried all kinds of things but to no avail....
The end function is to configure the rgb and lcd prior to entering the infinite while loop. If I run code I get all the transactions and am sitting at the LPM3_bits + GIE.
__bis_SR_register(GIE);
/*
* initialize RGB
*/
nonZeroBufDepth = I2C_TxArray_Builder((uint8_t *)InitializeRGB, sizeof(InitializeRGB), RGB_W);
i2cstate = I2CWRITE;
sendI2C_data(pI2CStream, nonZeroBufDepth, RGB_12C_ADDRESS);
while(i2cstate != I2CIDLE);
/*
* initialize LCD
*/
nonZeroBufDepth = I2C_TxArray_Builder((uint8_t *)initializeLCD, sizeof(initializeLCD), LCD_multiW);
i2cstate = I2CWRITE;
sendI2C_data(pI2CStream, nonZeroBufDepth, LCD_12C_ADDRESS);
while(1)
{
__bis_SR_register(LPM3_bits + GIE);
if (ISR.I2CComplete)
{
/*
* house-keeping
*/
ISR.I2CComplete = F;
i2cstate = I2CIDLE;
i2c_cnt = 0;
memset((void *)lcd_rgb_data, 0, sizeof(lcd_rgb_data));
pI2CStream = lcd_rgb_data;
}
}
}
#pragma vector = USCI_B0_VECTOR
__interrupt void I2C_ISR(void)
{
uint8_t rcv;
switch(__even_in_range(UCB0IV, USCI_I2C_UCBIT9IFG))
{
case USCI_NONE: break;
case USCI_I2C_UCALIFG: break;
case USCI_I2C_UCNACKIFG: break;
case USCI_I2C_UCSTTIFG: break;
case USCI_I2C_UCSTPIFG:
ISR.I2CComplete = T;
i2cstate = I2CSTOP;
LPM3_EXIT;
break;
