X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Flpc%2Fao_arch_funcs.h;h=dbb415381ce28c980cf78f31da38ada52fad1f55;hb=7348cc4736c9a94f9ad299edd78199b544d0e95a;hp=1bbb14f5b8773338a643ea1b7488cde0f8e319a1;hpb=be9ee9ed2d041c4ab4e77ee2010fe3c7a1ca6597;p=fw%2Faltos diff --git a/src/lpc/ao_arch_funcs.h b/src/lpc/ao_arch_funcs.h index 1bbb14f5..dbb41538 100644 --- a/src/lpc/ao_arch_funcs.h +++ b/src/lpc/ao_arch_funcs.h @@ -22,24 +22,34 @@ #define ao_spi_put_bit(reg,bit,pin,bus) ao_spi_put_mask(reg,(1<dr = byte; + while ((lpc_ssp->sr & (1 << LPC_SSP_SR_RNE)) == 0); + (void) lpc_ssp->dr; +} + #define ao_spi_init_cs(port, mask) do { \ uint8_t __bit__; \ for (__bit__ = 0; __bit__ < 32; __bit__++) { \ @@ -227,6 +268,7 @@ static inline void ao_arch_start_scheduler(void) { asm("mrs %0,control" : "=&r" (control)); control |= (1 << 1); asm("msr control,%0" : : "r" (control)); + asm("isb"); } #endif /* _AO_ARCH_FUNCS_H_ */