/* Configure SPI_CS as output and set it low. */
gpio0->data_dir |= (1 << I2C_CS_PIN);
gpio0->clear = (1 << I2C_CS_PIN);
- return 1;
+ return 0;
}
void I2C_CS_Default_Release(void)
{
char ctrl_buf[CMD_BUF_SIZE] = { I2C_CONT, I2C_CONT, I2C_DO_REPEATED_START, I2C_CONT, };
int eeprom_type = 0;
- if (spi_device_cs_pull_low() == 0) {
+ if (spi_device_cs_pull_low() != 0) {
return -EBUSY;
}
eeprom_type = get_eeprom_type();
char full_buff[(EEPROM_ID_MAX_PAGE_SIZE + MAX_CMD_SIZE)];
int eeprom_type = 0;
- if (spi_device_cs_pull_low() == 0) {
+ if (spi_device_cs_pull_low() != 0) {
return -EBUSY;
}
eeprom_type = get_eeprom_type();
void spi_device_cs_release(void)
{
struct lpc_gpio* gpio0 = LPC_GPIO_0;
+
+ /* Release mutex */
+ sync_lock_release(&spi_cs_mutex);
+
/* Set pin high */
gpio0->set = (1 << SPI_CS_PIN);
/* Configure pin as SPI again */