aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
authorFabien Poussin <fabien.poussin@gmail.com>2018-03-14 20:15:13 +0100
committerFabien Poussin <fabien.poussin@gmail.com>2018-03-14 20:15:13 +0100
commit424c7a2717fb6b2a847cec5c0060e3236f25e97f (patch)
treeb41f66639a1bcafa9d8ddbf8feb800d8cd7ffbbd /os/hal
parent1bfe2ef9f7f39d93174b1f62ac4b079aac2dea59 (diff)
downloadChibiOS-Contrib-424c7a2717fb6b2a847cec5c0060e3236f25e97f.tar.gz
ChibiOS-Contrib-424c7a2717fb6b2a847cec5c0060e3236f25e97f.tar.bz2
ChibiOS-Contrib-424c7a2717fb6b2a847cec5c0060e3236f25e97f.zip
Fixed most testhal examples for STM32, updated configs using script. Fixed deprecated MS2ST calls.
Diffstat (limited to 'os/hal')
-rw-r--r--os/hal/include/hal_community.h2
-rw-r--r--os/hal/include/usbh/dev/uvc.h2
-rw-r--r--os/hal/ports/KINETIS/LLD/hal_i2c_lld.c2
-rw-r--r--os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c2
-rw-r--r--os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c8
-rw-r--r--os/hal/ports/STM32/STM32F0xx/platform.mk2
-rw-r--r--os/hal/src/hal_ee24xx.c2
-rw-r--r--os/hal/src/usbh/hal_usbh_aoa.c4
-rw-r--r--os/hal/src/usbh/hal_usbh_ftdi.c8
-rw-r--r--os/hal/src/usbh/hal_usbh_msd.c8
10 files changed, 20 insertions, 20 deletions
diff --git a/os/hal/include/hal_community.h b/os/hal/include/hal_community.h
index cdedad6..83b1f02 100644
--- a/os/hal/include/hal_community.h
+++ b/os/hal/include/hal_community.h
@@ -48,7 +48,7 @@
#endif
#if !defined(HAL_USE_QEI)
-#define HAL_USE_QEI FALSE
+#define HAL_USE_QEI FALSE
#endif
#if !defined(HAL_USE_RNG)
diff --git a/os/hal/include/usbh/dev/uvc.h b/os/hal/include/usbh/dev/uvc.h
index 817d465..0477312 100644
--- a/os/hal/include/usbh/dev/uvc.h
+++ b/os/hal/include/usbh/dev/uvc.h
@@ -430,7 +430,7 @@ extern "C" {
static inline msg_t usbhuvcLockAndFetchS(USBHUVCDriver *uvcdp, msg_t *msg, systime_t timeout) {
chMtxLockS(&uvcdp->mtx);
- msg_t ret = chMBFetchS(&uvcdp->mb, msg, timeout);
+ msg_t ret = chMBFetchTimeoutS(&uvcdp->mb, msg, timeout);
if (ret != MSG_OK)
chMtxUnlockS(&uvcdp->mtx);
return ret;
diff --git a/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c b/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c
index c6b3d11..a005c32 100644
--- a/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c
+++ b/os/hal/ports/KINETIS/LLD/hal_i2c_lld.c
@@ -442,7 +442,7 @@ static inline msg_t _i2c_txrx_timeout(I2CDriver *i2cp, i2caddr_t addr,
/* wait until the bus is released */
/* Calculating the time window for the timeout on the busy bus condition.*/
start = osalOsGetSystemTimeX();
- end = start + OSAL_MS2ST(KINETIS_I2C_BUSY_TIMEOUT);
+ end = start + OSAL_TIME_MS2I(KINETIS_I2C_BUSY_TIMEOUT);
while(true) {
osalSysLock();
diff --git a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c
index 500b2e7..71c6ada 100644
--- a/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c
+++ b/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c
@@ -159,7 +159,7 @@ void fsmc_stop(FSMCDriver *fsmcp) {
#if HAL_USE_NAND
nvicDisableVector(STM32_FSMC_NUMBER);
#endif
- rccDisableFSMC(FALSE);
+ rccDisableFSMC();
}
#endif /* STM32_FSMC_USE_FSMC1 */
diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
index 4723508..15d8853 100644
--- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
+++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
@@ -1665,9 +1665,9 @@ usbh_urbstatus_t usbh_lld_root_hub_request(USBHDriver *usbh, uint8_t bmRequestTy
* despite reporting a successful por enable. */
uerr("Detected enabled port; resetting OTG core");
otg->GAHBCFG = 0;
- osalThreadSleepS(MS2ST(20));
+ osalThreadSleepS(TIME_MS2I(20));
_usbh_start(usbh); /* this effectively resets the core */
- osalThreadSleepS(MS2ST(100)); /* during this delay, the core generates connect ISR */
+ osalThreadSleepS(TIME_MS2I(100)); /* during this delay, the core generates connect ISR */
uinfo("OTG reset ended");
if (otg->HPRT & HPRT_PCSTS) {
/* if the device is still connected, don't report a C_CONNECTION flag, which would cause
@@ -1680,9 +1680,9 @@ usbh_urbstatus_t usbh_lld_root_hub_request(USBHDriver *usbh, uint8_t bmRequestTy
hprt &= ~(HPRT_PSUSP | HPRT_PENA | HPRT_PCDET | HPRT_PENCHNG | HPRT_POCCHNG);
while ((otg->GRSTCTL & GRSTCTL_AHBIDL) == 0);
otg->HPRT = hprt | HPRT_PRST;
- osalThreadSleepS(MS2ST(15));
+ osalThreadSleepS(TIME_MS2I(15));
otg->HPRT = hprt;
- osalThreadSleepS(MS2ST(10));
+ osalThreadSleepS(TIME_MS2I(10));
usbh->rootport.lld_c_status |= USBH_PORTSTATUS_C_RESET;
osalSysUnlock();
} break;
diff --git a/os/hal/ports/STM32/STM32F0xx/platform.mk b/os/hal/ports/STM32/STM32F0xx/platform.mk
index 377acdf..0102162 100644
--- a/os/hal/ports/STM32/STM32F0xx/platform.mk
+++ b/os/hal/ports/STM32/STM32F0xx/platform.mk
@@ -2,7 +2,7 @@ include ${CHIBIOS}/os/hal/ports/STM32/STM32F0xx/platform.mk
PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1/hal_crc_lld.c \
${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_timcap_lld.c \
- ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c \
+ ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1/hal_qei_lld.c
PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/CRCv1 \
${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/TIMv1 \
diff --git a/os/hal/src/hal_ee24xx.c b/os/hal/src/hal_ee24xx.c
index 632ffbb..164530e 100644
--- a/os/hal/src/hal_ee24xx.c
+++ b/os/hal/src/hal_ee24xx.c
@@ -105,7 +105,7 @@ static systime_t calc_timeout(I2CDriver *i2cp, size_t txbytes, size_t rxbytes) {
tmo = ((txbytes + rxbytes + 1) * bitsinbyte * 1000);
tmo /= EEPROM_I2C_CLOCK;
tmo += 10; /* some additional milliseconds to be safer */
- return MS2ST(tmo);
+ return TIME_MS2I(tmo);
}
/**
diff --git a/os/hal/src/usbh/hal_usbh_aoa.c b/os/hal/src/usbh/hal_usbh_aoa.c
index 85c3130..5e0fc48 100644
--- a/os/hal/src/usbh/hal_usbh_aoa.c
+++ b/os/hal/src/usbh/hal_usbh_aoa.c
@@ -533,7 +533,7 @@ static void _vt(void *p) {
if ((aoacp->iq_counter == 0) && !usbhURBIsBusy(&aoacp->iq_urb)) {
_submitInI(aoacp);
}
- chVTSetI(&aoacp->vt, MS2ST(16), _vt, aoacp);
+ chVTSetI(&aoacp->vt, TIME_MS2I(16), _vt, aoacp);
osalSysUnlockFromISR();
}
@@ -565,7 +565,7 @@ void usbhaoaChannelStart(USBHAOADriver *aoap) {
usbhURBSubmit(&aoacp->iq_urb);
chVTObjectInit(&aoacp->vt);
- chVTSet(&aoacp->vt, MS2ST(16), _vt, aoacp);
+ chVTSet(&aoacp->vt, TIME_MS2I(16), _vt, aoacp);
aoacp->state = USBHAOA_CHANNEL_STATE_READY;
diff --git a/os/hal/src/usbh/hal_usbh_ftdi.c b/os/hal/src/usbh/hal_usbh_ftdi.c
index 6fb556d..4def19a 100644
--- a/os/hal/src/usbh/hal_usbh_ftdi.c
+++ b/os/hal/src/usbh/hal_usbh_ftdi.c
@@ -332,7 +332,7 @@ static usbh_urbstatus_t _ftdi_port_control(USBHFTDIPortDriver *ftdipp,
wLength
};
- return usbhControlRequestExtended(ftdipp->ftdip->dev, &req, buff, NULL, MS2ST(1000));
+ return usbhControlRequestExtended(ftdipp->ftdip->dev, &req, buff, NULL, TIME_MS2I(1000));
}
static uint32_t _get_divisor(uint32_t baud, usbhftdi_type_t type) {
@@ -394,7 +394,7 @@ static usbh_urbstatus_t _set_baudrate(USBHFTDIPortDriver *ftdipp, uint32_t baudr
wIndex,
0
};
- return usbhControlRequestExtended(ftdipp->ftdip->dev, &req, NULL, NULL, MS2ST(1000));
+ return usbhControlRequestExtended(ftdipp->ftdip->dev, &req, NULL, NULL, TIME_MS2I(1000));
}
@@ -610,7 +610,7 @@ static void _vt(void *p) {
if ((ftdipp->iq_counter == 0) && !usbhURBIsBusy(&ftdipp->iq_urb)) {
_submitInI(ftdipp);
}
- chVTSetI(&ftdipp->vt, MS2ST(16), _vt, ftdipp);
+ chVTSetI(&ftdipp->vt, TIME_MS2I(16), _vt, ftdipp);
osalSysUnlockFromISR();
}
@@ -690,7 +690,7 @@ void usbhftdipStart(USBHFTDIPortDriver *ftdipp, const USBHFTDIPortConfig *config
usbhURBSubmit(&ftdipp->iq_urb);
chVTObjectInit(&ftdipp->vt);
- chVTSet(&ftdipp->vt, MS2ST(16), _vt, ftdipp);
+ chVTSet(&ftdipp->vt, TIME_MS2I(16), _vt, ftdipp);
ftdipp->state = USBHFTDIP_STATE_READY;
osalMutexUnlock(&ftdipp->ftdip->mtx);
diff --git a/os/hal/src/usbh/hal_usbh_msd.c b/os/hal/src/usbh/hal_usbh_msd.c
index 069c47b..d5bbdeb 100644
--- a/os/hal/src/usbh/hal_usbh_msd.c
+++ b/os/hal/src/usbh/hal_usbh_msd.c
@@ -304,7 +304,7 @@ static msd_bot_result_t _msd_bot_transaction(msd_transaction_t *tran, USBHMassSt
/* control phase */
status = usbhBulkTransfer(&lunp->msdp->epout, tran->cbw,
- sizeof(*tran->cbw), &actual_len, MS2ST(1000));
+ sizeof(*tran->cbw), &actual_len, TIME_MS2I(1000));
if (status == USBH_URBSTATUS_CANCELLED) {
uerr("\tMSD: Control phase: USBH_URBSTATUS_CANCELLED");
@@ -327,7 +327,7 @@ static msd_bot_result_t _msd_bot_transaction(msd_transaction_t *tran, USBHMassSt
ep,
data,
tran->cbw->dCBWDataTransferLength,
- &data_actual_len, MS2ST(20000));
+ &data_actual_len, TIME_MS2I(20000));
if (status == USBH_URBSTATUS_CANCELLED) {
uerr("\tMSD: Data phase: USBH_URBSTATUS_CANCELLED");
@@ -349,7 +349,7 @@ static msd_bot_result_t _msd_bot_transaction(msd_transaction_t *tran, USBHMassSt
/* status phase */
status = usbhBulkTransfer(&lunp->msdp->epin, &csw,
- sizeof(csw), &actual_len, MS2ST(1000));
+ sizeof(csw), &actual_len, TIME_MS2I(1000));
if (status == USBH_URBSTATUS_STALL) {
uwarn("\tMSD: Status phase: USBH_URBSTATUS_STALL, clear halt and retry");
@@ -358,7 +358,7 @@ static msd_bot_result_t _msd_bot_transaction(msd_transaction_t *tran, USBHMassSt
if (status == USBH_URBSTATUS_OK) {
status = usbhBulkTransfer(&lunp->msdp->epin, &csw,
- sizeof(csw), &actual_len, MS2ST(1000));
+ sizeof(csw), &actual_len, TIME_MS2I(1000));
}
}