spi_master, ulp: fix aliasing errors in unit tests
This commit is contained in:
parent
b0af8ad22f
commit
253930acd1
|
@ -759,7 +759,7 @@ static void task_slave(void* arg)
|
||||||
do {
|
do {
|
||||||
TEST_ESP_OK( spi_slave_transmit( context->spi, &t, portMAX_DELAY ) );
|
TEST_ESP_OK( spi_slave_transmit( context->spi, &t, portMAX_DELAY ) );
|
||||||
} while ( t.trans_len == 0 );
|
} while ( t.trans_len == 0 );
|
||||||
*(uint32_t*)recvbuf = t.trans_len;
|
memcpy(recvbuf, &t.trans_len, sizeof(uint32_t));
|
||||||
*(uint8_t**)(recvbuf+4) = txdata.start;
|
*(uint8_t**)(recvbuf+4) = txdata.start;
|
||||||
ESP_LOGI( SLAVE_TAG, "received: %d", t.trans_len );
|
ESP_LOGI( SLAVE_TAG, "received: %d", t.trans_len );
|
||||||
xRingbufferSend( ringbuf, recvbuf, 8+(t.trans_len+7)/8, portMAX_DELAY );
|
xRingbufferSend( ringbuf, recvbuf, 8+(t.trans_len+7)/8, portMAX_DELAY );
|
||||||
|
|
|
@ -271,7 +271,7 @@ TEST_CASE("ulp power consumption in deep sleep", "[ulp][ignore]")
|
||||||
{
|
{
|
||||||
assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 4 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig");
|
assert(CONFIG_ULP_COPROC_RESERVE_MEM >= 4 && "this test needs ULP_COPROC_RESERVE_MEM option set in menuconfig");
|
||||||
ulp_insn_t insn = I_HALT();
|
ulp_insn_t insn = I_HALT();
|
||||||
RTC_SLOW_MEM[0] = *(uint32_t*) &insn;
|
memcpy(&RTC_SLOW_MEM[0], &insn, sizeof(insn));
|
||||||
|
|
||||||
REG_WRITE(SENS_ULP_CP_SLEEP_CYC0_REG, 0x8000);
|
REG_WRITE(SENS_ULP_CP_SLEEP_CYC0_REG, 0x8000);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue