mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
improve ABSTRACT_METHOD error info.
This commit is contained in:
parent
76ce590713
commit
77e291101f
@ -27,16 +27,13 @@ void PikaStdDevice_ADC_setPin(PikaObj* self, char* pin) {
|
||||
}
|
||||
|
||||
void PikaStdDevice_ADC_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_ADC_platformDisable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_ADC_platformRead(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -26,6 +26,5 @@ void PikaStdDevice_BaseDev_addEventCallBack(PikaObj* self, Arg* eventCallBack) {
|
||||
}
|
||||
|
||||
void PikaStdDevice_BaseDev_platformGetEventId(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -9,8 +9,7 @@ void PikaStdDevice_CAN_addFilter(PikaObj* self,
|
||||
int mask,
|
||||
int mode,
|
||||
int rtr) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_disable(PikaObj* self) {
|
||||
@ -60,31 +59,25 @@ void PikaStdDevice_CAN_writeBytes(PikaObj *self, uint8_t* data, int length){
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_platformDisable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_platformRead(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_platformWrite(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_platformReadBytes(PikaObj *self){
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_platformWriteBytes(PikaObj *self){
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -80,40 +80,33 @@ void PikaStdDevice_GPIO_setPin(PikaObj* self, char* pinName) {
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformDisable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformLow(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformHigh(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformSetMode(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformOff(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformOn(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformRead(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -61,31 +61,25 @@ Arg* PikaStdDevice_IIC_readBytes(PikaObj* self, int addr, int length) {
|
||||
}
|
||||
|
||||
void PikaStdDevice_IIC_platformWrite(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_IIC_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_IIC_platformDisable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_IIC_platformRead(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_IIC_platformReadBytes(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_IIC_platformWriteBytes(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -44,21 +44,17 @@ int PikaStdDevice_PWM_getFrequency(PikaObj* self) {
|
||||
}
|
||||
|
||||
void PikaStdDevice_PWM_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
void PikaStdDevice_PWM_platformSetDuty(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
void PikaStdDevice_PWM_platformSetFrequency(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_PWM_platformDisable(PikaObj *self){
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
char* PikaStdDevice_PWM_getName(PikaObj* self) {
|
||||
|
@ -75,31 +75,25 @@ void PikaStdDevice_SPI_setPolarity(PikaObj* self, int polarity) {
|
||||
}
|
||||
|
||||
void PikaStdDevice_SPI_platformDisable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_SPI_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_SPI_platformWrite(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_SPI_platformRead(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_SPI_platformWriteBytes(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_SPI_platformReadBytes(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -13,8 +13,7 @@ void PikaStdDevice_Time_sleep_ms(PikaObj* self, int ms) {
|
||||
#elif defined(_WIN32)
|
||||
Sleep(ms);
|
||||
#else
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
#endif
|
||||
}
|
||||
void PikaStdDevice_Time_sleep_s(PikaObj* self, int s) {
|
||||
@ -23,8 +22,7 @@ void PikaStdDevice_Time_sleep_s(PikaObj* self, int s) {
|
||||
#elif defined(_WIN32)
|
||||
Sleep(s * 1000);
|
||||
#else
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -48,29 +48,23 @@ void PikaStdDevice_UART_writeBytes(PikaObj *self, uint8_t* data, int length){
|
||||
}
|
||||
|
||||
void PikaStdDevice_UART_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
void PikaStdDevice_UART_platformRead(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
void PikaStdDevice_UART_platformWrite(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_UART_platformDisable(PikaObj *self){
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_UART_platformReadBytes(PikaObj *self){
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_UART_platformWriteBytes(PikaObj *self){
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ void PikaStdData_List_set(PikaObj* self, int i, Arg* arg) {
|
||||
PikaList* list = obj_getPtr(self, "list");
|
||||
if (PIKA_RES_OK != list_setArg(list, i, arg)) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error]: index exceeded lengh of list.");
|
||||
obj_setSysOut(self, "Error: index exceeded lengh of list.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -213,5 +213,5 @@ void PikaStdTask_Task_run_until_ms(PikaObj* self, int until_ms) {
|
||||
|
||||
void PikaStdTask_Task_platformGetTick(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
__platform_printf("Error: abstract method %s need implament", __FUNCTION__);
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ static void prime_number_100(benchmark::State& state) {
|
||||
pikaVM_runByteCodeFrame(pikaMain, &bytecode_frame);
|
||||
num = obj_getInt(pikaMain, (char*)"num");
|
||||
if (1060 != num) {
|
||||
printf("[error]: prime_number_100\r\n");
|
||||
printf("Error: prime_number_100\r\n");
|
||||
}
|
||||
obj_deinit(pikaMain);
|
||||
}
|
||||
@ -91,7 +91,7 @@ static void prime_number_100_c(benchmark::State& state) {
|
||||
}
|
||||
}
|
||||
if (1060 != num) {
|
||||
printf("[error]: prime_number_100\r\n");
|
||||
printf("Error: prime_number_100\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ void checker_assertMemFree()
|
||||
pikaMemMaxReset();
|
||||
return;
|
||||
}
|
||||
printf("[Error]: Memory free error.\r\n");
|
||||
printf("Error: Memory free error.\r\n");
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
|
@ -27,16 +27,13 @@ void PikaStdDevice_ADC_setPin(PikaObj* self, char* pin) {
|
||||
}
|
||||
|
||||
void PikaStdDevice_ADC_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_ADC_platformDisable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_ADC_platformRead(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -26,6 +26,5 @@ void PikaStdDevice_BaseDev_addEventCallBack(PikaObj* self, Arg* eventCallBack) {
|
||||
}
|
||||
|
||||
void PikaStdDevice_BaseDev_platformGetEventId(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -9,8 +9,7 @@ void PikaStdDevice_CAN_addFilter(PikaObj* self,
|
||||
int mask,
|
||||
int mode,
|
||||
int rtr) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_disable(PikaObj* self) {
|
||||
@ -60,31 +59,25 @@ void PikaStdDevice_CAN_writeBytes(PikaObj *self, uint8_t* data, int length){
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_platformDisable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_platformRead(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_platformWrite(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_platformReadBytes(PikaObj *self){
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_CAN_platformWriteBytes(PikaObj *self){
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -80,40 +80,33 @@ void PikaStdDevice_GPIO_setPin(PikaObj* self, char* pinName) {
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformDisable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformLow(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformHigh(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformSetMode(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformOff(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformOn(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_GPIO_platformRead(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -61,31 +61,25 @@ Arg* PikaStdDevice_IIC_readBytes(PikaObj* self, int addr, int length) {
|
||||
}
|
||||
|
||||
void PikaStdDevice_IIC_platformWrite(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_IIC_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_IIC_platformDisable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_IIC_platformRead(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_IIC_platformReadBytes(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_IIC_platformWriteBytes(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -44,21 +44,17 @@ int PikaStdDevice_PWM_getFrequency(PikaObj* self) {
|
||||
}
|
||||
|
||||
void PikaStdDevice_PWM_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
void PikaStdDevice_PWM_platformSetDuty(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
void PikaStdDevice_PWM_platformSetFrequency(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_PWM_platformDisable(PikaObj *self){
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
char* PikaStdDevice_PWM_getName(PikaObj* self) {
|
||||
|
@ -75,31 +75,25 @@ void PikaStdDevice_SPI_setPolarity(PikaObj* self, int polarity) {
|
||||
}
|
||||
|
||||
void PikaStdDevice_SPI_platformDisable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_SPI_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_SPI_platformWrite(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_SPI_platformRead(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_SPI_platformWriteBytes(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_SPI_platformReadBytes(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -13,8 +13,7 @@ void PikaStdDevice_Time_sleep_ms(PikaObj* self, int ms) {
|
||||
#elif defined(_WIN32)
|
||||
Sleep(ms);
|
||||
#else
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
#endif
|
||||
}
|
||||
void PikaStdDevice_Time_sleep_s(PikaObj* self, int s) {
|
||||
@ -23,8 +22,7 @@ void PikaStdDevice_Time_sleep_s(PikaObj* self, int s) {
|
||||
#elif defined(_WIN32)
|
||||
Sleep(s * 1000);
|
||||
#else
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -48,29 +48,23 @@ void PikaStdDevice_UART_writeBytes(PikaObj *self, uint8_t* data, int length){
|
||||
}
|
||||
|
||||
void PikaStdDevice_UART_platformEnable(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
void PikaStdDevice_UART_platformRead(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
void PikaStdDevice_UART_platformWrite(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_UART_platformDisable(PikaObj *self){
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_UART_platformReadBytes(PikaObj *self){
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
||||
void PikaStdDevice_UART_platformWriteBytes(PikaObj *self){
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
ABSTRACT_METHOD_DECLARE();
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ void PikaStdData_List_set(PikaObj* self, int i, Arg* arg) {
|
||||
PikaList* list = obj_getPtr(self, "list");
|
||||
if (PIKA_RES_OK != list_setArg(list, i, arg)) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error]: index exceeded lengh of list.");
|
||||
obj_setSysOut(self, "Error: index exceeded lengh of list.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -213,5 +213,5 @@ void PikaStdTask_Task_run_until_ms(PikaObj* self, int until_ms) {
|
||||
|
||||
void PikaStdTask_Task_platformGetTick(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
__platform_printf("Error: abstract method %s need implament", __FUNCTION__);
|
||||
}
|
||||
|
@ -1099,7 +1099,7 @@ TEST(pikaMain, synac_err_1) {
|
||||
__platform_printf("BEGIN\r\n");
|
||||
obj_run(pikaMain, "print('testtest)\n");
|
||||
/* assert */
|
||||
EXPECT_STREQ(log_buff[0], "[error]: Syntax error.\r\n");
|
||||
EXPECT_STREQ(log_buff[0], "Error: Syntax error.\r\n");
|
||||
EXPECT_STREQ(log_buff[1], "BEGIN\r\n");
|
||||
/* deinit */
|
||||
obj_deinit(pikaMain);
|
||||
@ -1432,7 +1432,7 @@ TEST(pikaMain, not_4_space) {
|
||||
pikaVM_run(pikaMain, " print('test')\n");
|
||||
/* collect */
|
||||
/* assert */
|
||||
EXPECT_STREQ(log_buff[0], "[error]: Syntax error.\r\n");
|
||||
EXPECT_STREQ(log_buff[0], "Error: Syntax error.\r\n");
|
||||
EXPECT_STREQ(
|
||||
log_buff[1],
|
||||
"IndentationError: unexpected indent, only support 4 spaces\r\n");
|
||||
@ -2523,7 +2523,7 @@ TEST(pikaMain, syantex_issue123lkjxi) {
|
||||
obj_run(pikaMain, lines);
|
||||
/* collect */
|
||||
/* assert */
|
||||
EXPECT_STREQ(log_buff[0], "[error]: Syntax error.\r\n");
|
||||
EXPECT_STREQ(log_buff[0], "Error: Syntax error.\r\n");
|
||||
/* deinit */
|
||||
obj_deinit(pikaMain);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
@ -2539,7 +2539,7 @@ TEST(pikaMain, syantex_issue_fae13) {
|
||||
obj_run(pikaMain, lines);
|
||||
/* collect */
|
||||
/* assert */
|
||||
EXPECT_STREQ(log_buff[0], "[error]: Syntax error.\r\n");
|
||||
EXPECT_STREQ(log_buff[0], "Error: Syntax error.\r\n");
|
||||
/* deinit */
|
||||
obj_deinit(pikaMain);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
@ -2555,7 +2555,7 @@ TEST(pikaMain, syantex_issue_1289341) {
|
||||
obj_run(pikaMain, lines);
|
||||
/* collect */
|
||||
/* assert */
|
||||
EXPECT_STREQ(log_buff[0], "[error]: Syntax error.\r\n");
|
||||
EXPECT_STREQ(log_buff[0], "Error: Syntax error.\r\n");
|
||||
/* deinit */
|
||||
obj_deinit(pikaMain);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
@ -2571,7 +2571,7 @@ TEST(pikaMain, syantex_issue_183571) {
|
||||
obj_run(pikaMain, lines);
|
||||
/* collect */
|
||||
/* assert */
|
||||
EXPECT_STREQ(log_buff[0], "[error]: Syntax error.\r\n");
|
||||
EXPECT_STREQ(log_buff[0], "Error: Syntax error.\r\n");
|
||||
/* deinit */
|
||||
obj_deinit(pikaMain);
|
||||
EXPECT_EQ(pikaMemNow(), 0);
|
||||
|
@ -295,4 +295,9 @@ void* obj_getStruct(PikaObj* self, char* name);
|
||||
#define obj_setStruct(PikaObj_p_self, char_p_name, struct_) \
|
||||
args_setStruct(((PikaObj_p_self)->list), char_p_name, struct_)
|
||||
|
||||
#define ABSTRACT_METHOD_DECLARE(x) \
|
||||
obj_setErrorCode(self, 1); \
|
||||
__platform_printf("Error: abstract method `%s()` need override.\r\n", \
|
||||
__FUNCTION__)
|
||||
|
||||
#endif
|
||||
|
@ -114,7 +114,7 @@ PIKA_WEAK char __platform_getchar(void) {
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return getchar();
|
||||
#else
|
||||
__platform_printf("[error]: __platform_getchar need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_getchar need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
@ -125,7 +125,7 @@ PIKA_WEAK FILE* __platform_fopen(const char* filename, const char* modes) {
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return fopen(filename, modes);
|
||||
#else
|
||||
__platform_printf("[error]: __platform_fopen need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_fopen need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
@ -136,7 +136,7 @@ PIKA_WEAK int __platform_fclose(FILE* stream) {
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return fclose(stream);
|
||||
#else
|
||||
__platform_printf("[error]: __platform_fclose need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_fclose need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
@ -150,7 +150,7 @@ PIKA_WEAK size_t __platform_fwrite(const void* ptr,
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return fwrite(ptr, size, n, stream);
|
||||
#else
|
||||
__platform_printf("[error]: __platform_fwrite need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_fwrite need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
@ -164,7 +164,7 @@ PIKA_WEAK size_t __platform_fread(void* ptr,
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return fread(ptr, size, n, stream);
|
||||
#else
|
||||
__platform_printf("[error]: __platform_fread need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_fread need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
@ -175,7 +175,7 @@ PIKA_WEAK int __platform_fseek(FILE* stream, long offset, int whence) {
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return fseek(stream, offset, whence);
|
||||
#else
|
||||
__platform_printf("[error]: __platform_fseek need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_fseek need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
@ -186,7 +186,7 @@ PIKA_WEAK long __platform_ftell(FILE* stream) {
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return ftell(stream);
|
||||
#else
|
||||
__platform_printf("[error]: __platform_ftell need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_ftell need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
|
@ -1973,7 +1973,7 @@ static VMParameters* __pikaVM_runPyLines_or_byteCode(PikaObj* self,
|
||||
/* generate byte code */
|
||||
byteCodeFrame_init(bytecode_frame_p);
|
||||
if (1 == bytecodeFrame_fromLines(bytecode_frame_p, py_lines)) {
|
||||
__platform_printf("[error]: Syntax error.\r\n");
|
||||
__platform_printf("Error: Syntax error.\r\n");
|
||||
globals = NULL;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ void* pikaMalloc(uint32_t size) {
|
||||
__platform_enable_irq_handle();
|
||||
if (NULL == mem) {
|
||||
__platform_printf(
|
||||
"[error]: No heap space! Please reset the device.\r\n");
|
||||
"Error: No heap space! Please reset the device.\r\n");
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user