Skip to content

Commit 0bbf99d

Browse files
committed
fixed examples
1 parent 04868cb commit 0bbf99d

File tree

6 files changed

+16
-18
lines changed

6 files changed

+16
-18
lines changed

examples/nucleo_f042k6/spi_dma/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ int main()
3333
uint8_t receiveBuffer[13];
3434

3535
// send out 12 bytes, don't care about response
36-
Spi::transferBlocking(sendBuffer, nullptr, 12);
36+
Spi::transferBlocking(sendBuffer, (uint8_t*)(nullptr), 12);
3737

3838
// send out 12 bytes, read in 12 bytes
3939
Spi::transferBlocking(sendBuffer, receiveBuffer, 12);

examples/nucleo_f303re/spi_dma/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ int main()
3333
uint8_t receiveBuffer[13];
3434

3535
// send out 12 bytes, don't care about response
36-
Spi::transferBlocking(sendBuffer, nullptr, 12);
36+
Spi::transferBlocking(sendBuffer, (uint8_t*)(nullptr), 12);
3737

3838
// send out 12 bytes, read in 12 bytes
3939
Spi::transferBlocking(sendBuffer, receiveBuffer, 12);

examples/nucleo_l432kc/spi_dma/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int main()
3434
uint8_t receiveBuffer[13];
3535

3636
// send out 12 bytes, don't care about response
37-
Spi::transferBlocking(sendBuffer, nullptr, 12);
37+
Spi::transferBlocking(sendBuffer, (uint8_t*)(nullptr), 12);
3838

3939
// send out 12 bytes, read in 12 bytes
4040
Spi::transferBlocking(sendBuffer, receiveBuffer, 12);

examples/nucleo_l452re/graphics_touch/main.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace touch
5151
//using Interrupt = modm::platform::GpioA10;
5252
}
5353

54-
modm::Touch2046<touch::Spi, touch::Cs> touchController;
54+
modm::Touch2046<touch::Spi, touch::Cs, 320, 240> touchController;
5555

5656

5757
int
@@ -75,12 +75,10 @@ main()
7575
touch::Mosi::Mosi>();
7676
touch::Spi::initialize<SystemClock, 2500_kHz>();
7777
modm::touch2046::Calibration cal{
78-
.OffsetX = -11,
79-
.OffsetY = 335,
8078
.FactorX = 22018,
79+
.OffsetX = -11,
8180
.FactorY = -29358,
82-
.MaxX = 240,
83-
.MaxY = 320,
81+
.OffsetY = 335,
8482
.ThresholdZ = 500,
8583
};
8684
touchController.setCalibration(cal);
@@ -107,22 +105,22 @@ main()
107105

108106
int16_t X = 0;
109107
int16_t Y = 0;
110-
int16_t Z = 0;
108+
// int16_t Z = 0;
111109

112110
while (true)
113111
{
114112
LedGreen::set();
115113

116-
std::tie(X, Y, Z) = RF_CALL_BLOCKING(touchController.getRawValues());
114+
std::tie(X, Y) = RF_CALL_BLOCKING(touchController.getTouchPosition());
117115
tftController.setColor(Red);
118116
tftController.fillRectangle({30, 50}, 90, 115);
119117
tftController.setColor(Black);
120118
tftController.setCursor(0, 50);
121119
tftController << "X=" << X;
122120
tftController.setCursor(0, 90);
123121
tftController << "Y=" << Y;
124-
tftController.setCursor(0, 130);
125-
tftController << "Z=" << Z;
122+
// tftController.setCursor(0, 130);
123+
// tftController << "Z=" << Z;
126124

127125
tftController.setColor(Red);
128126
tftController.fillRectangle({30, 220}, 120, 35);

examples/nucleo_l452re/lvgl/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ namespace touch
5959
//using Interrupt = modm::platform::GpioA10;
6060
}
6161

62-
modm::Touch2046<touch::Spi, touch::Cs> touchController;
62+
modm::Touch2046<touch::Spi, touch::Cs, 320, 240> touchController;
6363

6464

6565
static lv_disp_draw_buf_t disp_buf;

src/modm/driver/radio/sx1276_impl.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ Sx1276<SpiMaster, Cs>::transmit(uint8_t* data, uint8_t length)
173173

174174
Cs::reset();
175175

176-
RF_CALL(SpiMaster::transfer(buffer,nullptr,1));
177-
RF_CALL(SpiMaster::transfer(data,nullptr,length));
176+
RF_CALL(SpiMaster::transfer(buffer, (uint8_t*)(nullptr), 1));
177+
RF_CALL(SpiMaster::transfer(data, (uint8_t*)(nullptr), length));
178178

179179
if(this->releaseMaster())
180180
{
@@ -251,16 +251,16 @@ Sx1276<SpiMaster, Cs>::readPacket(uint8_t* data, uint8_t maxLength)
251251

252252
Cs::reset();
253253

254-
RF_CALL(SpiMaster::transfer(buffer,nullptr,1));
254+
RF_CALL(SpiMaster::transfer(buffer, (uint8_t*)(nullptr), 1));
255255
if(lastPacketSize > maxLength)
256256
{
257257
MODM_LOG_ERROR<<"SX1276: Read buffer is too small, packet discarded!"<<modm::endl;
258258
//read it out anyway to clean the fifo
259-
RF_CALL(SpiMaster::transfer(nullptr,nullptr,lastPacketSize));
259+
RF_CALL(SpiMaster::transfer((uint8_t*)(nullptr),(uint8_t*)(nullptr),lastPacketSize));
260260
}
261261
else
262262
{
263-
RF_CALL(SpiMaster::transfer(nullptr,data,lastPacketSize));
263+
RF_CALL(SpiMaster::transfer((uint8_t*)(nullptr), data, lastPacketSize));
264264
}
265265

266266
if(this->releaseMaster())

0 commit comments

Comments
 (0)