Код
uint32_t LOGGER_GetDelta(uint32_t address, unsigned char *delta_h_l)
{
uint32_t low_byte, high_byte;
// start read
SPI_CSlow();
// send command
SPI_SendByte(SPIEEPROM_CMD_READ);
// send address
SPI_SendByte(address>>8);
SPI_SendByte(address&0x00FF);
// read contents of memory address
SPI_TransferByte(0x00);
low_byte = majority32const(&USART1->RXDATA);
SPI_TransferByte(0x00);
high_byte = majority32const(&USART1->RXDATA);
// stop read
SPI_CShigh();
*delta_h_l = low_byte;
*(delta_h_l+1) = high_byte;
return ((high_byte << 8) | low_byte);
}
{
uint32_t low_byte, high_byte;
// start read
SPI_CSlow();
// send command
SPI_SendByte(SPIEEPROM_CMD_READ);
// send address
SPI_SendByte(address>>8);
SPI_SendByte(address&0x00FF);
// read contents of memory address
SPI_TransferByte(0x00);
low_byte = majority32const(&USART1->RXDATA);
SPI_TransferByte(0x00);
high_byte = majority32const(&USART1->RXDATA);
// stop read
SPI_CShigh();
*delta_h_l = low_byte;
*(delta_h_l+1) = high_byte;
return ((high_byte << 8) | low_byte);
}
Смотрю в дебаггере low_byte, high_byte получают правильные данные а *delta_h_l, *(delta_h_l+1) не получает ничего.