fixup __forceinline for cpp code and add kitchen_sink cpp test (#670)
* fix __force_inline for different GCC versions in cpp mode (the affected versions are different from c mode), and build kitchsink.c as a cpp file too for testing * silly bug in host platform.h
This commit is contained in:
@ -97,7 +97,7 @@ uint32_t *foo = (uint32_t *) 200;
|
||||
uint32_t dma_to = 0;
|
||||
uint32_t dma_from = 0xaaaa5555;
|
||||
|
||||
void spiggle(void) {
|
||||
void __noinline spiggle(void) {
|
||||
dma_channel_config c = dma_channel_get_default_config(1);
|
||||
channel_config_set_bswap(&c, true);
|
||||
channel_config_set_transfer_data_size(&c, DMA_SIZE_16);
|
||||
@ -106,6 +106,10 @@ void spiggle(void) {
|
||||
dma_channel_transfer_from_buffer_now(1, foo, 23);
|
||||
}
|
||||
|
||||
__force_inline int something_inlined(int x) {
|
||||
return x * 2;
|
||||
}
|
||||
|
||||
void __isr dma_handler_a(void) {
|
||||
printf("HELLO A\n");
|
||||
if (dma_hw->ints1 & 1) {
|
||||
@ -131,7 +135,7 @@ int main(void) {
|
||||
|
||||
stdio_init_all();
|
||||
|
||||
printf("HI %d\n", (int)time_us_32());
|
||||
printf("HI %d\n", something_inlined((int)time_us_32()));
|
||||
puts("Hello Everything!");
|
||||
puts("Hello Everything2!");
|
||||
|
||||
|
Reference in New Issue
Block a user