Browse Source

remove some warning

master
zhaohe 2 years ago
parent
commit
93c18d2c8a
  1. 5
      chip/basic/chip_helper.cpp
  2. 2
      components/hardware/uart/zuart_helper.cpp
  3. 2
      components/mini_servo_motor/feite_servo_motor.cpp
  4. 6
      components/mini_servo_motor/mini_servo_motor_ctrl_module.cpp
  5. 2
      components/sensors/smtp2/smtp2.cpp
  6. 2
      os/zos_thread.hpp
  7. 2
      os/zthread.cpp

5
chip/basic/chip_helper.cpp

@ -335,14 +335,15 @@ IRQn_Type chip_tim_get_irq(TIM_HandleTypeDef* tim) {
uint32_t chip_get_timer_clock_sorce_freq(TIM_HandleTypeDef* tim) {
uint32_t timClkFreq = 0;
#if 0
uint32_t pclk1Freq = HAL_RCC_GetPCLK1Freq();
uint32_t pclk2Freq = HAL_RCC_GetPCLK2Freq();
uint32_t sysClkFreq = HAL_RCC_GetSysClockFreq();
#endif
uint32_t pFLatency;
RCC_ClkInitTypeDef clkconfig;
HAL_RCC_GetClockConfig(&clkconfig, &pFLatency);
bool isAPB2 = false;
#ifdef TIM1
@ -409,7 +410,7 @@ bool chip_calculate_prescaler_and_autoreload_by_expect_freq(uint32_t timerInClk,
arr = arr - 1;
psc = psc - 1;
uint16_t comparevalue = 50 / 100.0 * arr;
// uint16_t comparevalue = 50 / 100.0 * arr;
*prescaler = psc;
*autoreload = arr;

2
components/hardware/uart/zuart_helper.cpp

@ -5,7 +5,7 @@
using namespace iflytop;
#define __DEBUG 0
#if __DEBUG
static void dumphex(char* tag, uint8_t* data, uint8_t len) {
static void dumphex(const char* tag, uint8_t* data, uint8_t len) {
printf("%s:", tag);
for (int i = 0; i < len; i++) {
printf("%02x ", data[i]);

2
components/mini_servo_motor/feite_servo_motor.cpp

@ -13,7 +13,7 @@ using namespace feite;
return false; \
}
static void dumphex(char* tag, uint8_t* data, uint8_t len) {
static void dumphex(const char* tag, uint8_t* data, uint8_t len) {
#if 0
printf("%s:", tag);
for (int i = 0; i < len; i++) {

6
components/mini_servo_motor/mini_servo_motor_ctrl_module.cpp

@ -61,7 +61,7 @@ int32_t MiniRobotCtrlModule::rotate(s32 speed, s32 torque, s32 run_time, action_
if (m_thread.getExitFlag() && run_time != 0) break;
if (m_thread.getExitFlag() && run_time == 0) break;
if (run_time != 0 && zos_haspassedms(entertime) > run_time) {
if (run_time != 0 && (zos_haspassedms(entertime) > (uint32_t)run_time)) {
stop(0);
call_status_cb(status_cb, 0);
break;
@ -363,7 +363,7 @@ int32_t MiniRobotCtrlModule::motor_move_to_torque(int32_t targetpos, int32_t tor
while (true) {
if (m_thread.getExitFlag()) break;
if (overtime != 0 && zos_haspassedms(entertime) > overtime) {
if (overtime != 0 && zos_haspassedms(entertime) > (uint32_t)overtime) {
ZLOGI(TAG, "%d motor_move_to_torque %d overtime", m_module_id, m_id);
stop(0);
set_errorcode(err::kmotor_run_overtime);
@ -397,4 +397,4 @@ int32_t MiniRobotCtrlModule::motor_move_to_zero_backward(int32_t findzerospeed,
int32_t MiniRobotCtrlModule::motor_read_pos(int32_t *pos) {
if (!m_bus->getNowPos(m_id, *pos)) return err::ksubdevice_overtime;
return 0;
}
}

2
components/sensors/smtp2/smtp2.cpp

@ -392,7 +392,7 @@ int32_t SMTP2::sendcmd_block(const char* cmd, size_t txlen, char* rxbuf, size_t
HAL_StatusTypeDef rxstatus = HAL_UART_Receive(m_uart, (uint8_t*)&rxbuf[rxnum], 1, 3);
if (rxstatus != HAL_OK) break;
if ('\n' == rxbuf[rxnum]) break;
if (rxnum >= rxbuflen - 2) break;
if (rxnum >= int(rxbuflen - 2)) break;
}
// printf("SMTP2:m_rxbuf:(%d) %s\n", rxnum, rxbuf);
rxlen = rxnum;

2
os/zos_thread.hpp

@ -4,7 +4,7 @@
namespace iflytop {
class ZOSThread {
osThreadId _defaultTaskHandle;
int _stack_size;
uint32_t _stack_size;
osPriority _priority;
function<void()> _func;
const char* _threadname;

2
os/zthread.cpp

@ -58,7 +58,7 @@ void ZThread::threadcb() {
}
void ZThread::init(const char *threadname, int stack_size, osPriority priority) {
int r_task_create = 0;
// int r_task_create = 0;
ZASSERT(threadname);
m_lock = xSemaphoreCreateMutex();

Loading…
Cancel
Save