Rev 508 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 508 | Rev 791 | ||
---|---|---|---|
Line 324... | Line 324... | ||
324 | if (I2C0_Bus.RxBufferSize == 0) // nothing to send? |
324 | if (I2C0_Bus.RxBufferSize == 0) // nothing to send? |
325 | { |
325 | { |
326 | I2C_GenerateSTOP (I2C0, ENABLE); |
326 | I2C_GenerateSTOP (I2C0, ENABLE); |
327 | VIC_ITCmd(I2C0_ITLine, DISABLE); |
327 | VIC_ITCmd(I2C0_ITLine, DISABLE); |
328 | I2C0_Bus.State = I2C_STATE_IDLE; |
328 | I2C0_Bus.State = I2C_STATE_IDLE; |
329 | I2C1_Bus.Error = I2C_ERROR_NONE; |
329 | I2C0_Bus.Error = I2C_ERROR_NONE; |
330 | return; |
330 | return; |
331 | } |
331 | } |
332 | else |
332 | else |
333 | { |
333 | { |
334 | I2C0_Bus.State = I2C_STATE_RX_PROGRESS; |
334 | I2C0_Bus.State = I2C_STATE_RX_PROGRESS; |
Line 336... | Line 336... | ||
336 | break; |
336 | break; |
Line 337... | Line 337... | ||
337 | 337 | ||
338 | default: // invalid direction |
338 | default: // invalid direction |
339 | I2C_GenerateSTOP (I2C0, ENABLE); |
339 | I2C_GenerateSTOP (I2C0, ENABLE); |
340 | VIC_ITCmd(I2C0_ITLine, DISABLE); |
340 | VIC_ITCmd(I2C0_ITLine, DISABLE); |
341 | I2C1_Bus.State = I2C_STATE_IDLE; |
341 | I2C0_Bus.State = I2C_STATE_IDLE; |
342 | I2C1_Bus.Error = I2C_ERROR_UNKNOWN; |
342 | I2C0_Bus.Error = I2C_ERROR_UNKNOWN; |
343 | return; |
343 | return; |
344 | } |
344 | } |
345 | // enable acknowledge |
345 | // enable acknowledge |
346 | I2C_AcknowledgeConfig (I2C0, ENABLE); |
346 | I2C_AcknowledgeConfig (I2C0, ENABLE); |