Revision c930aa01 unittests/periphery-lld/src/ut_alld_TLC5947_v1.c
| unittests/periphery-lld/src/ut_alld_TLC5947_v1.c | ||
|---|---|---|
| 61 | 61 |
|
| 62 | 62 |
// local variables |
| 63 | 63 |
aos_utresult_t result = {0, 0};
|
| 64 |
uint32_t status = 0;
|
|
| 64 |
int32_t status = 0; |
|
| 65 | 65 |
tlc5947_lld_blank_t blank; |
| 66 | 66 |
tlc5947_lld_buffer_t buffer; |
| 67 | 67 |
|
| ... | ... | |
| 150 | 150 |
tlc5947_lld_setBuffer(&buffer, channel, value); |
| 151 | 151 |
status |= tlc5947_lld_write((TLC5947Driver*)ut->data, &buffer); |
| 152 | 152 |
status |= tlc5947_lld_update((TLC5947Driver*)ut->data); |
| 153 |
aosThdSleep(1.0f / 3.0f);
|
|
| 153 |
aosThdSleep(10.0f / TLC5947_LLD_NUM_CHANNELS / 3.0f);
|
|
| 154 | 154 |
tlc5947_lld_setBuffer(&buffer, channel, 0); |
| 155 | 155 |
} |
| 156 | 156 |
} |
| ... | ... | |
| 162 | 162 |
|
| 163 | 163 |
chprintf(stream, "setting one color after another...\n"); |
| 164 | 164 |
status = APAL_STATUS_OK; |
| 165 |
for (int8_t color = 0; color < 3; ++color) {
|
|
| 165 |
for (uint8_t color = 0; color < 3; ++color) {
|
|
| 166 | 166 |
for (uint8_t channel = color; channel < TLC5947_LLD_NUM_CHANNELS; channel += 3) {
|
| 167 | 167 |
const uint16_t val = 0xAF5u; // some deterministic value with high entropy |
| 168 | 168 |
tlc5947_lld_setBuffer(&buffer, channel, val); |
| 169 | 169 |
status |= tlc5947_lld_write((TLC5947Driver*)ut->data, &buffer); |
| 170 | 170 |
status |= tlc5947_lld_update((TLC5947Driver*)ut->data); |
| 171 |
status |= (tlc5947_lld_getBuffer(&buffer, channel) != val) ? (1 << 31) : 0;
|
|
| 171 |
status |= (tlc5947_lld_getBuffer(&buffer, channel) != val) ? ((int32_t)1 << 30) : 0;
|
|
| 172 | 172 |
if (status != APAL_STATUS_OK) {
|
| 173 | 173 |
break; |
| 174 | 174 |
} else {
|
| 175 |
aosThdSleep(1.0f / 8.0f);
|
|
| 175 |
aosThdSleep(10.0f / TLC5947_LLD_NUM_CHANNELS / 3.0f);
|
|
| 176 | 176 |
} |
| 177 | 177 |
} |
| 178 | 178 |
for (uint8_t channel = 0; channel < TLC5947_LLD_NUM_CHANNELS; ++channel) {
|
Also available in: Unified diff