diff --git a/emBODY/eBcode/arch-arm/board/amc/examples/embot-os-hw/proj/amc-embot-os-hw.uvoptx b/emBODY/eBcode/arch-arm/board/amc/examples/embot-os-hw/proj/amc-embot-os-hw.uvoptx index aa985d6d4a..3391619040 100644 --- a/emBODY/eBcode/arch-arm/board/amc/examples/embot-os-hw/proj/amc-embot-os-hw.uvoptx +++ b/emBODY/eBcode/arch-arm/board/amc/examples/embot-os-hw/proj/amc-embot-os-hw.uvoptx @@ -393,7 +393,7 @@ 0 ARMRTXEVENTFLAGS - -L200 -Z20 -C0 -M1 -T1 + -L200 -Z14 -C0 -M1 -T1 0 @@ -415,66 +415,18 @@ 0 0 - 593 - 1 -
134235372
+ 2912 + 0 +
134232262
0 0 0 0 0 1 - ..\src\main-embot-os-hw.cpp + C:\dev\icub-firmware\emBODY\eBcode\arch-arm\libs\lowlevel\stm32hal\src\driver\stm32h7-v1A0\src\stm32h7xx_hal_spi.c - \\h7disco\../src/main-embot-os-hw.cpp\593 -
- - 1 - 0 - 584 - 1 -
134235260
- 0 - 0 - 0 - 0 - 0 - 1 - ..\src\main-embot-os-hw.cpp - - \\h7disco\../src/main-embot-os-hw.cpp\584 -
- - 2 - 0 - 153 - 1 -
134237678
- 0 - 0 - 0 - 0 - 0 - 1 - ..\..\..\..\..\embot\hw\embot_hw_flash.cpp - - \\h7disco\../../../../../embot/hw/embot_hw_flash.cpp\153 -
- - 3 - 0 - 588 - 1 -
134235296
- 0 - 0 - 0 - 0 - 0 - 1 - ..\src\main-embot-os-hw.cpp - - \\h7disco\../src/main-embot-os-hw.cpp\588 + \\h7disco\../src/driver/stm32h7-v1A0/src/stm32h7xx_hal_spi.c\2912
@@ -520,10 +472,18 @@ 1 0 - 0x08120000 + hspi->pTxBuffPtr 0 + + + 2 + 0 + pTxBuffPtr + 0 + + 0 @@ -544,7 +504,7 @@ 0 0 0 - 0 + 1 0 0 1 @@ -566,6 +526,16 @@ + + + OS Support\Event Viewer + 35904 + + + System Viewer\SPI1 + 35905 + + 1 0 @@ -1482,7 +1452,7 @@ main - 1 + 0 0 0 0 @@ -1502,7 +1472,7 @@ stm32hal - 1 + 0 0 0 0 @@ -1630,7 +1600,7 @@ embot-hw - 1 + 0 0 0 0 @@ -1790,6 +1760,18 @@ 0 0 + + 6 + 23 + 8 + 0 + 0 + 0 + ..\..\..\..\..\embot\hw\embot_hw_timer.cpp + embot_hw_timer.cpp + 0 + 0 + @@ -1800,7 +1782,7 @@ 0 7 - 23 + 24 8 0 0 @@ -1812,7 +1794,7 @@ 7 - 24 + 25 8 0 0 @@ -1824,7 +1806,7 @@ 7 - 25 + 26 8 0 0 @@ -1836,7 +1818,7 @@ 7 - 26 + 27 8 0 0 @@ -1848,7 +1830,7 @@ 7 - 27 + 28 8 0 0 @@ -1860,7 +1842,7 @@ 7 - 28 + 29 8 0 0 @@ -1872,7 +1854,7 @@ 7 - 29 + 30 8 0 0 @@ -1884,7 +1866,7 @@ 7 - 30 + 31 8 0 0 @@ -1898,13 +1880,13 @@ embot-app - 1 + 0 0 0 0 8 - 31 + 32 8 0 0 @@ -1918,13 +1900,13 @@ embot::hw::bsp - 1 + 0 0 0 0 9 - 32 + 33 8 0 0 diff --git a/emBODY/eBcode/arch-arm/board/amc/examples/embot-os-hw/proj/amc-embot-os-hw.uvprojx b/emBODY/eBcode/arch-arm/board/amc/examples/embot-os-hw/proj/amc-embot-os-hw.uvprojx index 5480d6b48d..a6ec985d9e 100644 --- a/emBODY/eBcode/arch-arm/board/amc/examples/embot-os-hw/proj/amc-embot-os-hw.uvprojx +++ b/emBODY/eBcode/arch-arm/board/amc/examples/embot-os-hw/proj/amc-embot-os-hw.uvprojx @@ -16,7 +16,7 @@ STM32H745IIKx:CM7 STMicroelectronics - Keil.STM32H7xx_DFP.2.8.0 + Keil.STM32H7xx_DFP.3.0.0 http://www.keil.com/pack/ IRAM(0x38000000,0x00010000) IRAM2(0x24000000,0x00080000) IROM(0x08000000,0x00100000) XRAM(0x20000000,0x00020000) CPUTYPE("Cortex-M7") FPU3(DFPU) CLOCK(12000000) ELITTLE @@ -186,6 +186,7 @@ 3 0 0 + 0 1 0 8 @@ -588,6 +589,11 @@ 8 ..\..\..\..\..\embot\hw\embot_hw_chip_AS5045.cpp + + embot_hw_timer.cpp + 8 + ..\..\..\..\..\embot\hw\embot_hw_timer.cpp + @@ -661,13 +667,13 @@ demo-embot-osal-stlinkv3 0x4 ARM-ADS - 6160000::V6.16::ARMCLANG + 6180000::V6.18::ARMCLANG 1 STM32H745IIKx:CM7 STMicroelectronics - Keil.STM32H7xx_DFP.2.8.0 + Keil.STM32H7xx_DFP.3.0.0 http://www.keil.com/pack/ IRAM(0x38000000,0x00010000) IRAM2(0x24000000,0x00080000) IROM(0x08000000,0x00100000) XRAM(0x20000000,0x00020000) CPUTYPE("Cortex-M7") FPU3(DFPU) CLOCK(12000000) ELITTLE @@ -837,6 +843,7 @@ 3 0 0 + 0 1 0 8 @@ -1239,6 +1246,11 @@ 8 ..\..\..\..\..\embot\hw\embot_hw_chip_AS5045.cpp + + embot_hw_timer.cpp + 8 + ..\..\..\..\..\embot\hw\embot_hw_timer.cpp + @@ -1318,7 +1330,7 @@ STM32H745IIKx:CM7 STMicroelectronics - Keil.STM32H7xx_DFP.2.8.0 + Keil.STM32H7xx_DFP.3.0.0 http://www.keil.com/pack/ IRAM(0x38000000,0x00010000) IRAM2(0x24000000,0x00080000) IROM(0x08000000,0x00100000) XRAM(0x20000000,0x00020000) CPUTYPE("Cortex-M7") FPU3(DFPU) CLOCK(12000000) ELITTLE @@ -1488,6 +1500,7 @@ 3 0 0 + 0 1 0 8 @@ -1941,6 +1954,11 @@ 8 ..\..\..\..\..\embot\hw\embot_hw_chip_AS5045.cpp + + embot_hw_timer.cpp + 8 + ..\..\..\..\..\embot\hw\embot_hw_timer.cpp + @@ -2020,7 +2038,7 @@ STM32H745IIKx:CM7 STMicroelectronics - Keil.STM32H7xx_DFP.2.8.0 + Keil.STM32H7xx_DFP.3.0.0 http://www.keil.com/pack/ IRAM(0x38000000,0x00010000) IRAM2(0x24000000,0x00080000) IROM(0x08000000,0x00100000) XRAM(0x20000000,0x00020000) CPUTYPE("Cortex-M7") FPU3(DFPU) CLOCK(12000000) ELITTLE @@ -2190,6 +2208,7 @@ 3 0 0 + 0 1 0 8 @@ -2643,6 +2662,11 @@ 8 ..\..\..\..\..\embot\hw\embot_hw_chip_AS5045.cpp + + embot_hw_timer.cpp + 8 + ..\..\..\..\..\embot\hw\embot_hw_timer.cpp + @@ -2722,7 +2746,7 @@ STM32H745IIKx:CM7 STMicroelectronics - Keil.STM32H7xx_DFP.2.8.0 + Keil.STM32H7xx_DFP.3.0.0 http://www.keil.com/pack/ IRAM(0x38000000,0x00010000) IRAM2(0x24000000,0x00080000) IROM(0x08000000,0x00100000) XRAM(0x20000000,0x00020000) CPUTYPE("Cortex-M7") FPU3(DFPU) CLOCK(12000000) ELITTLE @@ -2892,6 +2916,7 @@ 3 0 0 + 0 1 0 8 @@ -3345,6 +3370,11 @@ 8 ..\..\..\..\..\embot\hw\embot_hw_chip_AS5045.cpp + + embot_hw_timer.cpp + 8 + ..\..\..\..\..\embot\hw\embot_hw_timer.cpp + @@ -3424,7 +3454,7 @@ STM32H745IIKx:CM7 STMicroelectronics - Keil.STM32H7xx_DFP.2.8.0 + Keil.STM32H7xx_DFP.3.0.0 http://www.keil.com/pack/ IRAM(0x38000000,0x00010000) IRAM2(0x24000000,0x00080000) IROM(0x08000000,0x00100000) XRAM(0x20000000,0x00020000) CPUTYPE("Cortex-M7") FPU3(DFPU) CLOCK(12000000) ELITTLE @@ -3594,6 +3624,7 @@ 3 0 0 + 0 1 0 8 @@ -3996,6 +4027,11 @@ 8 ..\..\..\..\..\embot\hw\embot_hw_chip_AS5045.cpp + + embot_hw_timer.cpp + 8 + ..\..\..\..\..\embot\hw\embot_hw_timer.cpp + diff --git a/emBODY/eBcode/arch-arm/embot/hw/embot_hw_timer.cpp b/emBODY/eBcode/arch-arm/embot/hw/embot_hw_timer.cpp index 26723926d3..b265cb7a72 100644 --- a/emBODY/eBcode/arch-arm/embot/hw/embot_hw_timer.cpp +++ b/emBODY/eBcode/arch-arm/embot/hw/embot_hw_timer.cpp @@ -465,8 +465,9 @@ namespace embot { namespace hw { namespace timer { struct TIMERprop { - bool isrunning; - Config config; + bool isrunning {false}; + Config config {}; + Status status {Status::none}; }; struct propsOFalltimers @@ -496,6 +497,7 @@ namespace embot { namespace hw { namespace timer { if(Mode::oneshot == prop.config.mode) { + prop.status = Status::expired; stop(t); } } @@ -518,6 +520,7 @@ namespace embot { namespace hw { namespace timer { TIMERprop &prop = s_properties.get(t); prop.isrunning = false; prop.config = config; + prop.status = Status::idle; // VERY IMPORTANT: keep it in here before configure... embot::core::binary::bit::set(initialisedmask, embot::core::tointegral(t)); @@ -575,6 +578,7 @@ namespace embot { namespace hw { namespace timer { } prop.isrunning = true; + prop.status = Status::running; // ok: the timer starts. const embot::hw::timer::PROP * stm32props = embot::hw::timer::getBSP().getPROP(t); @@ -600,9 +604,25 @@ namespace embot { namespace hw { namespace timer { TIMERprop &prop = s_properties.get(t); prop.isrunning = false; + if(prop.status != Status::expired) + { + prop.status = Status::idle; + } return resOK; } + + Status status(embot::hw::TIMER t) + { + if(false == initialised(t)) + { + return Status::none; + } + + TIMERprop &prop = s_properties.get(t); + + return prop.status; + } }}} // namespace embot { namespace hw { namespace tim {