Skip to content

Commit 6e7d4ab

Browse files
committed
build system: Add float_math feature
This adds the float_math feature to express that math on floating point numbers is supported. All CPUs but native provide this, to reflect that apps using floats on native will randomly fail See #495
1 parent 950adfa commit 6e7d4ab

File tree

10 files changed

+18
-5
lines changed

10 files changed

+18
-5
lines changed

cpu/arm7_common/Makefile.features

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ FEATURES_PROVIDED += arch_32bit
55
FEATURES_PROVIDED += arch_arm
66
FEATURES_PROVIDED += arch_arm7
77
FEATURES_PROVIDED += cpp
8+
FEATURES_PROVIDED += float_math
89
FEATURES_PROVIDED += libstdcpp
910
FEATURES_PROVIDED += newlib
1011
FEATURES_PROVIDED += periph_pm

cpu/atmega_common/Makefile.features

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ include $(RIOTCPU)/avr8_common/Makefile.features
33
# common feature are defined in avr8_common/Makefile.features
44
# Only add Additional features
55

6-
FEATURES_PROVIDED += cpu_core_atmega
76
FEATURES_PROVIDED += atmega_pcint0
7+
FEATURES_PROVIDED += cpu_core_atmega
8+
FEATURES_PROVIDED += float_math
89
FEATURES_PROVIDED += periph_eeprom
9-
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
1010
FEATURES_PROVIDED += periph_gpio_ll
1111
FEATURES_PROVIDED += periph_gpio_ll_input_pull_up
1212
FEATURES_PROVIDED += periph_gpio_ll_irq
1313
FEATURES_PROVIDED += periph_gpio_ll_irq_edge_triggered_both
1414
FEATURES_PROVIDED += periph_gpio_ll_irq_level_triggered_low
1515
FEATURES_PROVIDED += periph_gpio_ll_irq_unmask
1616
FEATURES_PROVIDED += periph_gpio_ll_switch_dir
17+
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
1718
FEATURES_PROVIDED += periph_pm
1819
FEATURES_PROVIDED += periph_rtc_ms
1920
FEATURES_PROVIDED += periph_rtt_overflow

cpu/cortexm_common/Makefile.features

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ FEATURES_PROVIDED += cpp
66
FEATURES_PROVIDED += cpu_check_address
77
FEATURES_PROVIDED += cpu_core_cortexm
88
FEATURES_PROVIDED += dbgpin
9+
FEATURES_PROVIDED += float_math
910
FEATURES_PROVIDED += libstdcpp
1011
FEATURES_PROVIDED += newlib
1112
FEATURES_PROVIDED += periph_flashpage_aux

cpu/esp_common/Makefile.features

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ FEATURES_PROVIDED += arch_32bit
44
FEATURES_PROVIDED += arch_esp
55
FEATURES_PROVIDED += cpp
66
FEATURES_PROVIDED += esp_spiffs
7+
FEATURES_PROVIDED += float_math
78
FEATURES_PROVIDED += libstdcpp
89
FEATURES_PROVIDED += newlib
910
FEATURES_PROVIDED += periph_cpuid

cpu/msp430/Makefile.features

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ FEATURES_PROVIDED += arch_msp430
1717
FEATURES_PROVIDED += bug_newlib_broken_stdio
1818
FEATURES_PROVIDED += cpu_$(CPU_FAM)
1919
FEATURES_PROVIDED += dbgpin
20+
FEATURES_PROVIDED += float_math
2021
FEATURES_PROVIDED += newlib
2122
FEATURES_PROVIDED += periph_flashpage
2223
FEATURES_PROVIDED += periph_flashpage_in_address_space
2324
FEATURES_PROVIDED += periph_flashpage_pagewise
24-
FEATURES_PROVIDED += periph_pm
25-
FEATURES_PROVIDED += periph_timer_query_freqs
26-
2725
FEATURES_PROVIDED += periph_gpio_ll
2826
FEATURES_PROVIDED += periph_gpio_ll_irq
2927
FEATURES_PROVIDED += periph_gpio_ll_switch_dir
28+
FEATURES_PROVIDED += periph_pm
29+
FEATURES_PROVIDED += periph_timer_query_freqs

cpu/riscv_common/Makefile.features

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ FEATURES_PROVIDED += arch_32bit
66
FEATURES_PROVIDED += arch_riscv
77
FEATURES_PROVIDED += bug_newlib_broken_stdio
88
FEATURES_PROVIDED += cpp
9+
FEATURES_PROVIDED += float_math
910
FEATURES_PROVIDED += libstdcpp
1011
FEATURES_PROVIDED += newlib
1112
FEATURES_PROVIDED += periph_coretimer

features.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,9 @@ groups:
468468
a mandatory requirement to build Rust code.
469469
- name: emulator_renode
470470
help: The platform is compatible with the Renode emulator.
471+
- name: float_math
472+
help: The use of float point math is possible. This requires either a
473+
hardware FPU or a working software FPU.
471474

472475
- title: Peripheral Features
473476
help: These features indicate presence of peripheral IP block, presence of

makefiles/features_existing.inc.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ FEATURES_EXISTING := \
129129
esp_wifi_ap \
130130
esp_wifi_enterprise \
131131
feather_shield \
132+
float_math \
132133
gecko_sdk_librail_fpu \
133134
gecko_sdk_librail_nonfpu \
134135
highlevel_stdio \

makefiles/features_modules.inc.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ USEMODULE += $(filter vdd_lc_filter_%,$(FEATURES_USED))
124124
# select arduino_pwm pseudomodule if the corresponding feature is used
125125
USEMODULE += $(filter arduino_pwm, $(FEATURES_USED))
126126

127+
# select float_math pseudomodule when corresponding feature is used
128+
USEMODULE += $(filter float_math, $(FEATURES_USED))
129+
127130
# always register a peripheral driver as a required feature when the corresponding
128131
# module is requested
129132
PERIPH_IGNORE_MODULES += periph_usbdev_clk periph_gpio_mock periph_gpio_linux periph_spidev_linux

makefiles/pseudomodules.inc.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ PSEUDOMODULES += event_timeout_ztimer
7979
PSEUDOMODULES += evtimer_mbox
8080
PSEUDOMODULES += fatfs_vfs_format
8181
PSEUDOMODULES += fdcan
82+
PSEUDOMODULES += float_math
8283
PSEUDOMODULES += fmt_%
8384
PSEUDOMODULES += gcoap_forward_proxy
8485
PSEUDOMODULES += gcoap_forward_proxy_thread

0 commit comments

Comments
 (0)