Skip to content

Commit 1be1fa2

Browse files
committed
[c++] Cleanup lambda function declarations
1 parent 73c16cb commit 1be1fa2

File tree

27 files changed

+55
-43
lines changed

27 files changed

+55
-43
lines changed

examples/avr/fiber_benchmark/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ struct Test
5555
} test;
5656

5757
modm::Fiber fiber1(fiber_function1);
58-
modm::Fiber fiber2(+[](){ fiber_function2(cycles); });
59-
modm::Fiber fiber3(+[](){ test.fiber_function3(); });
58+
modm::Fiber fiber2([]{ fiber_function2(cycles); });
59+
modm::Fiber fiber3([]{ test.fiber_function3(); });
6060
modm::Fiber fiber4([cyc=uint32_t(cycles)]() mutable { cyc++; test.fiber_function4(cyc); });
6161

6262
// ATmega2560@16MHz: 239996 yields in 2492668us, 96280 yields per second, 10386ns per yield

examples/avr/ports/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ int main()
7979

8080
PinGroup::setOutput(modm::Gpio::High); modm::delay(1s);
8181

82-
const auto fn_report = []() {
82+
const auto fn_report = []
83+
{
8384
MODM_LOG_INFO << modm::bin << PinGroup::read() << modm::endl; modm::delay(200ms);
8485
};
8586

examples/generic/fiber/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,24 +57,24 @@ struct Test
5757
} test;
5858

5959
// Single purpose fibers to time the yield
60-
modm_faststack modm::Fiber fiber_y1([](){ modm::this_fiber::yield(); counter.stop(); });
61-
modm_faststack modm::Fiber fiber_y2([](){ counter.start(); modm::this_fiber::yield(); });
60+
modm_faststack modm::Fiber fiber_y1([]{ modm::this_fiber::yield(); counter.stop(); });
61+
modm_faststack modm::Fiber fiber_y2([]{ counter.start(); modm::this_fiber::yield(); });
6262

6363
modm_faststack modm::Fiber fiber1(fiber_function1, modm::fiber::Start::Later);
64-
modm_faststack modm::Fiber fiber2([](){ fiber_function2(cycles); }, modm::fiber::Start::Later);
65-
modm_faststack modm::Fiber fiber3([](){ test.fiber_function3(); }, modm::fiber::Start::Later);
64+
modm_faststack modm::Fiber fiber2([]{ fiber_function2(cycles); }, modm::fiber::Start::Later);
65+
modm_faststack modm::Fiber fiber3([]{ test.fiber_function3(); }, modm::fiber::Start::Later);
6666
modm_faststack modm::Fiber fiber4([cyc=uint32_t(0)]() mutable
6767
{ cyc = cycles; test.fiber_function4(cyc); }, modm::fiber::Start::Later);
6868

6969
// Restartable Fibers
7070
extern modm::Fiber<> fiber_pong;
7171
extern modm::Fiber<> fiber_ping;
72-
modm_faststack modm::Fiber<> fiber_ping([](){
72+
modm_faststack modm::Fiber<> fiber_ping([]{
7373
MODM_LOG_INFO << "ping = " << fiber_ping.stack_usage() << modm::endl;
7474
modm::this_fiber::sleep_for(1s);
7575
fiber_pong.start();
7676
}, modm::fiber::Start::Later);
77-
modm_faststack modm::Fiber<> fiber_pong([](){
77+
modm_faststack modm::Fiber<> fiber_pong([]{
7878
MODM_LOG_INFO << "pong = " << fiber_pong.stack_usage() << modm::endl;
7979
modm::this_fiber::sleep_for(1s);
8080
fiber_ping.start();

examples/nucleo_f429zi/spi_flash_fatfs/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ int test_diskio()
313313

314314
modm_faststack modm::Fiber testFiber(test_diskio);
315315

316-
modm_faststack modm::Fiber blinkyFiber([]()
316+
modm_faststack modm::Fiber blinkyFiber([]
317317
{
318318
Board::Leds::setOutput();
319319
while(true)

examples/nucleo_g474re/dac_dma/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ void setupDac4()
6767

6868
// switch between signals when transfer completed
6969
static bool toggleBit = false;
70-
Dma1::Channel1::setTransferCompleteIrqHandler([]() {
70+
Dma1::Channel1::setTransferCompleteIrqHandler([]
71+
{
7172
DacChannel::stopDma();
7273
toggleBit = !toggleBit;
7374
if (toggleBit) {

examples/nucleo_l552ze-q/dac_dma/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ void setupDac()
4747

4848
// switch between signals when transfer completed
4949
static bool toggleBit = false;
50-
Dma1::Channel1::setTransferCompleteIrqHandler([]() {
50+
Dma1::Channel1::setTransferCompleteIrqHandler([]
51+
{
5152
DacChannel::stopDma();
5253
toggleBit = !toggleBit;
5354
if (toggleBit) {

examples/rp_pico/fiber/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ fiber_function2(CoreData& d)
6161
modm_fastdata_core0 CoreData d0;
6262
modm_fastdata_core1 CoreData d1;
6363

64-
modm_faststack_core0 modm::Fiber<256> fiber01([](){fiber_function1(d0);});
65-
modm_faststack_core0 modm::Fiber<256> fiber02([](){fiber_function2(d0);});
64+
modm_faststack_core0 modm::Fiber<256> fiber01([]{fiber_function1(d0);});
65+
modm_faststack_core0 modm::Fiber<256> fiber02([]{fiber_function2(d0);});
6666
// Do not autostart these fibers, otherwise they run on the Core0 scheduler!
6767
modm_faststack_core1
68-
modm::Fiber<256> fiber11([](){fiber_function1(d1);}, modm::fiber::Start::Later);
68+
modm::Fiber<256> fiber11([]{fiber_function1(d1);}, modm::fiber::Start::Later);
6969
modm_faststack_core1
70-
modm::Fiber<256> fiber12([](){fiber_function2(d1);}, modm::fiber::Start::Later);
70+
modm::Fiber<256> fiber12([]{fiber_function2(d1);}, modm::fiber::Start::Later);
7171

7272
template<typename TimeDiff>
7373
static void

examples/samv71_xplained_ultra/fdcan/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ main()
3737

3838
Mcan1::setMode(Mcan1::Mode::TestExternalLoopback);
3939

40-
Mcan1::setErrorInterruptCallback([](){
40+
Mcan1::setErrorInterruptCallback([]{
4141
Board::Led1::set();
4242
});
4343

examples/stm32f469_discovery/ports/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ main()
8383

8484
PinGroup::setOutput(modm::Gpio::High); modm::delay(1s);
8585

86-
const auto fn_report = []() {
86+
const auto fn_report = []
87+
{
8788
MODM_LOG_INFO << modm::bin << PinGroup::read() << modm::endl; modm::delay(200ms);
8889
};
8990

src/modm/communication/amnb/module.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ using namespace modm::amnb;
149149

150150
Action actions[] =
151151
{
152-
{0, []()
152+
{0, []
153153
{
154154
// request without payload, automatic good reponse
155155
}
156156
},
157-
{1, []() -> Response
157+
{1, [] -> Response
158158
{
159159
// return user error or response without payloads
160160
return failure ? ErrorReponse() : Response();

0 commit comments

Comments
 (0)