Commit 00129c66 authored by Astro's avatar Astro
Browse files

firmware: update to v1.10

parent 3e9bbc74
Pipeline #3864 passed with stage
in 10 minutes and 13 seconds
Subproject commit c7b7bc8468f94f52c2af115b795d98b6b0974852
Subproject commit 9325a21266bf5647410d803539190962aa646a84
......@@ -215,7 +215,7 @@ uint8_t epic_buttons_read(uint8_t mask)
}
/* Autogenerated stub for API_GPIO_SET_PIN_MODE */
int epic_gpio_set_pin_mode(uint8_t pin, uint8_t mode)
int epic_gpio_set_pin_mode( uint8_t pin, uint8_t mode )
{
const int epc__apistub_size = sizeof(uint8_t) + sizeof(uint8_t);
void*epc__apistub_buffer;
......@@ -289,8 +289,23 @@ void epic_leds_set(int led, uint8_t r, uint8_t g, uint8_t b)
_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_LEDS_GET */
int epic_leds_get_rgb(int led, uint8_t * rgb)
{
const int epc__apistub_size = sizeof(int) + sizeof(uint8_t *);
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_LEDS_GET, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
*(int*)(epc__apistub_buffer + 0) = led;
*(uint8_t **)(epc__apistub_buffer + sizeof(int)) = rgb;
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_LEDS_SET_HSV */
void epic_leds_set_hsv(int led, float h, float s, float v)
void epic_leds_set_hsv( int led, float h, float s, float v )
{
const int epc__apistub_size = sizeof(int) + sizeof(float) + sizeof(float) + sizeof(float);
void*epc__apistub_buffer;
......@@ -322,7 +337,7 @@ void epic_leds_set_all(uint8_t *pattern, uint8_t len)
}
/* Autogenerated stub for API_LEDS_SET_ALL_HSV */
void epic_leds_set_all_hsv(float *pattern, uint8_t len)
void epic_leds_set_all_hsv( float *pattern, uint8_t len )
{
const int epc__apistub_size = sizeof(float *) + sizeof(uint8_t);
void*epc__apistub_buffer;
......@@ -337,7 +352,7 @@ void epic_leds_set_all_hsv(float *pattern, uint8_t len)
}
/* Autogenerated stub for API_LEDS_PREP */
void epic_leds_prep(int led, uint8_t r, uint8_t g, uint8_t b)
void epic_leds_prep( int led, uint8_t r, uint8_t g, uint8_t b )
{
const int epc__apistub_size = sizeof(int) + sizeof(uint8_t) + sizeof(uint8_t) + sizeof(uint8_t);
void*epc__apistub_buffer;
......@@ -354,7 +369,7 @@ void epic_leds_prep(int led, uint8_t r, uint8_t g, uint8_t b)
}
/* Autogenerated stub for API_LEDS_PREP_HSV */
void epic_leds_prep_hsv(int led, float h, float s, float v)
void epic_leds_prep_hsv( int led, float h, float s, float v )
{
const int epc__apistub_size = sizeof(int) + sizeof(float) + sizeof(float) + sizeof(float);
void*epc__apistub_buffer;
......@@ -440,6 +455,20 @@ void epic_leds_set_rocket(int led, uint8_t value)
_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_LEDS_GET_ROCKET */
int epic_leds_get_rocket(int led)
{
const int epc__apistub_size = sizeof(int);
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_LEDS_GET_ROCKET, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
*(int*)(epc__apistub_buffer + 0) = led;
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_LEDS_SET_FLASHLIGHT */
void epic_set_flashlight(_Bool power)
{
......@@ -470,7 +499,7 @@ void epic_leds_set_gamma_table( uint8_t rgb_channel, uint8_t *gamma_table )
}
/* Autogenerated stub for API_LEDS_CLEAR_ALL */
void epic_leds_clear_all(uint8_t r, uint8_t g, uint8_t b)
void epic_leds_clear_all( uint8_t r, uint8_t g, uint8_t b )
{
const int epc__apistub_size = sizeof(uint8_t) + sizeof(uint8_t) + sizeof(uint8_t);
void*epc__apistub_buffer;
......@@ -512,7 +541,7 @@ int epic_bme680_deinit()
}
/* Autogenerated stub for API_BME680_GET_DATA */
int epic_bme680_read_sensors(struct bme680_sensor_data *data)
int epic_bme680_read_sensors( struct bme680_sensor_data *data )
{
const int epc__apistub_size = sizeof(struct bme680_sensor_data *);
void*epc__apistub_buffer;
......@@ -526,7 +555,7 @@ int epic_bme680_read_sensors(struct bme680_sensor_data *data)
}
/* Autogenerated stub for API_PERSONAL_STATE_SET */
int epic_personal_state_set(uint8_t state, _Bool persistent)
int epic_personal_state_set( uint8_t state, _Bool persistent )
{
const int epc__apistub_size = sizeof(uint8_t) + sizeof(_Bool);
void*epc__apistub_buffer;
......@@ -710,7 +739,7 @@ int epic_disp_print( uint16_t posx, uint16_t posy, const char *pString, uint16_t
}
/* Autogenerated stub for API_DISP_PRINT_ADV */
int epic_disp_print_adv( uint8_t font, uint16_t posx, uint16_t posy, const char *pString, uint16_t fg, uint16_t bg)
int epic_disp_print_adv( uint8_t font, uint16_t posx, uint16_t posy, const char *pString, uint16_t fg, uint16_t bg )
{
const int epc__apistub_size = sizeof(uint8_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(const char *) + sizeof(uint16_t) + sizeof(uint16_t);
void*epc__apistub_buffer;
......@@ -743,7 +772,7 @@ int epic_disp_clear(uint16_t color)
}
/* Autogenerated stub for API_DISP_PIXEL */
int epic_disp_pixel( uint16_t x, uint16_t y, uint16_t color)
int epic_disp_pixel( uint16_t x, uint16_t y, uint16_t color )
{
const int epc__apistub_size = sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint16_t);
void*epc__apistub_buffer;
......@@ -759,7 +788,7 @@ int epic_disp_pixel( uint16_t x, uint16_t y, uint16_t color)
}
/* Autogenerated stub for API_DISP_LINE */
int epic_disp_line( uint16_t xstart, uint16_t ystart, uint16_t xend, uint16_t yend, uint16_t color, enum disp_linestyle linestyle, uint16_t pixelsize)
int epic_disp_line( uint16_t xstart, uint16_t ystart, uint16_t xend, uint16_t yend, uint16_t color, enum disp_linestyle linestyle, uint16_t pixelsize )
{
const int epc__apistub_size = sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(enum disp_linestyle) + sizeof(uint16_t);
void*epc__apistub_buffer;
......@@ -779,7 +808,7 @@ int epic_disp_line( uint16_t xstart, uint16_t ystart, uint16_t xend, uint16_t ye
}
/* Autogenerated stub for API_DISP_RECT */
int epic_disp_rect( uint16_t xstart, uint16_t ystart, uint16_t xend, uint16_t yend, uint16_t color, enum disp_fillstyle fillstyle, uint16_t pixelsize)
int epic_disp_rect( uint16_t xstart, uint16_t ystart, uint16_t xend, uint16_t yend, uint16_t color, enum disp_fillstyle fillstyle, uint16_t pixelsize )
{
const int epc__apistub_size = sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(enum disp_fillstyle) + sizeof(uint16_t);
void*epc__apistub_buffer;
......@@ -799,7 +828,7 @@ int epic_disp_rect( uint16_t xstart, uint16_t ystart, uint16_t xend, uint16_t ye
}
/* Autogenerated stub for API_DISP_CIRC */
int epic_disp_circ( uint16_t x, uint16_t y, uint16_t rad, uint16_t color, enum disp_fillstyle fillstyle, uint16_t pixelsize)
int epic_disp_circ( uint16_t x, uint16_t y, uint16_t rad, uint16_t color, enum disp_fillstyle fillstyle, uint16_t pixelsize )
{
const int epc__apistub_size = sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(enum disp_fillstyle) + sizeof(uint16_t);
void*epc__apistub_buffer;
......@@ -818,7 +847,7 @@ int epic_disp_circ( uint16_t x, uint16_t y, uint16_t rad, uint16_t color, enum d
}
/* Autogenerated stub for API_DISP_FRAMEBUFFER */
int epic_disp_framebuffer(union disp_framebuffer *fb)
int epic_disp_framebuffer( union disp_framebuffer *fb )
{
const int epc__apistub_size = sizeof(union disp_framebuffer *);
void*epc__apistub_buffer;
......@@ -944,7 +973,7 @@ int epic_file_read(int fd, void* buf, size_t nbytes)
}
/* Autogenerated stub for API_FILE_WRITE */
int epic_file_write(int fd, const void* buf, size_t nbytes)
int epic_file_write( int fd, const void* buf, size_t nbytes )
{
const int epc__apistub_size = sizeof(int) + sizeof(const void*) + sizeof(size_t);
void*epc__apistub_buffer;
......@@ -1117,7 +1146,7 @@ uint64_t epic_rtc_get_milliseconds(void)
}
/* Autogenerated stub for API_RTC_SET_MILLISECONDS */
void epic_rtc_set_milliseconds(uint64_t milliseconds)
void epic_rtc_set_milliseconds( uint64_t milliseconds )
{
const int epc__apistub_size = sizeof(uint64_t);
void*epc__apistub_buffer;
......@@ -1174,7 +1203,7 @@ int epic_max30001_enable_sensor( struct max30001_sensor_config *config )
}
/* Autogenerated stub for API_MAX30001_DISABLE */
int epic_max30001_disable_sensor( void )
int epic_max30001_disable_sensor()
{
const int epc__apistub_size = 0;
void*epc__apistub_buffer;
......@@ -1225,24 +1254,40 @@ int epic_usb_cdcacm(void)
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_WS2812_WRITE */
void epic_ws2812_write(uint8_t pin, uint8_t *pixels, uint32_t n_bytes)
{
const int epc__apistub_size = sizeof(uint8_t) + sizeof(uint8_t *) + sizeof(uint32_t);
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_WS2812_WRITE, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
*(uint8_t*)(epc__apistub_buffer + 0) = pin;
*(uint8_t **)(epc__apistub_buffer + sizeof(uint8_t)) = pixels;
*(uint32_t*)(epc__apistub_buffer + sizeof(uint8_t) + sizeof(uint8_t *)) = n_bytes;
_api_call_transact(epc__apistub_buffer);
}
/* Weakly linked stubs for ISRs */
void epic_isr_bhi160_accelerometer(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_bhi160_orientation(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_bhi160_gyroscope(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_max30001_ecg(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void __epic_isr_reset(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_uart_rx(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_ctrl_c(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_bhi160_accelerometer(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_bhi160_orientation(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_bhi160_gyroscope(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_rtc_alarm(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_max30001_ecg(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
/* Default handler stub */
__attribute__((weak)) void epic_isr_default_handler(api_int_id_t id)
......@@ -1266,18 +1311,6 @@ void __epic_isr_default_handler(api_int_id_t id)
void __dispatch_isr(api_int_id_t id)
{
switch (id) {
case EPIC_INT_BHI160_ACCELEROMETER:
epic_isr_bhi160_accelerometer(id);
break;
case EPIC_INT_BHI160_ORIENTATION:
epic_isr_bhi160_orientation(id);
break;
case EPIC_INT_BHI160_GYROSCOPE:
epic_isr_bhi160_gyroscope(id);
break;
case EPIC_INT_MAX30001_ECG:
epic_isr_max30001_ecg(id);
break;
case EPIC_INT_RESET:
__epic_isr_reset(id);
break;
......@@ -1287,9 +1320,21 @@ void __dispatch_isr(api_int_id_t id)
case EPIC_INT_CTRL_C:
epic_isr_ctrl_c(id);
break;
case EPIC_INT_BHI160_ACCELEROMETER:
epic_isr_bhi160_accelerometer(id);
break;
case EPIC_INT_BHI160_ORIENTATION:
epic_isr_bhi160_orientation(id);
break;
case EPIC_INT_BHI160_GYROSCOPE:
epic_isr_bhi160_gyroscope(id);
break;
case EPIC_INT_RTC_ALARM:
epic_isr_rtc_alarm(id);
break;
case EPIC_INT_MAX30001_ECG:
epic_isr_max30001_ecg(id);
break;
case (-1):
/* Ignore a spurious interrupt */
break;
......
......@@ -109,6 +109,12 @@ void __api_dispatch_call(uint32_t id, void*epc__apistub_buffer)
*(uint8_t*)(epc__apistub_buffer + sizeof(int) + sizeof(uint8_t) + sizeof(uint8_t))
);
break;
case API_LEDS_GET:
*((int*)epc__apistub_buffer) = epic_leds_get_rgb(
*(int*)(epc__apistub_buffer + 0),
*(uint8_t **)(epc__apistub_buffer + sizeof(int))
);
break;
case API_LEDS_SET_HSV:
epic_leds_set_hsv(
*(int*)(epc__apistub_buffer + 0),
......@@ -170,6 +176,11 @@ void __api_dispatch_call(uint32_t id, void*epc__apistub_buffer)
*(uint8_t*)(epc__apistub_buffer + sizeof(int))
);
break;
case API_LEDS_GET_ROCKET:
*((int*)epc__apistub_buffer) = epic_leds_get_rocket(
*(int*)(epc__apistub_buffer + 0)
);
break;
case API_LEDS_SET_FLASHLIGHT:
epic_set_flashlight(
*(_Bool*)(epc__apistub_buffer + 0)
......@@ -268,6 +279,16 @@ void __api_dispatch_call(uint32_t id, void*epc__apistub_buffer)
*(uint16_t*)(epc__apistub_buffer + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(const char *) + sizeof(uint16_t))
);
break;
case API_DISP_PRINT_ADV:
*((int*)epc__apistub_buffer) = epic_disp_print_adv(
*(uint8_t*)(epc__apistub_buffer + 0),
*(uint16_t*)(epc__apistub_buffer + sizeof(uint8_t)),
*(uint16_t*)(epc__apistub_buffer + sizeof(uint8_t) + sizeof(uint16_t)),
*(const char **)(epc__apistub_buffer + sizeof(uint8_t) + sizeof(uint16_t) + sizeof(uint16_t)),
*(uint16_t*)(epc__apistub_buffer + sizeof(uint8_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(const char *)),
*(uint16_t*)(epc__apistub_buffer + sizeof(uint8_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(const char *) + sizeof(uint16_t))
);
break;
case API_DISP_CLEAR:
*((int*)epc__apistub_buffer) = epic_disp_clear(
*(uint16_t*)(epc__apistub_buffer + 0)
......@@ -459,6 +480,13 @@ void __api_dispatch_call(uint32_t id, void*epc__apistub_buffer)
*((int*)epc__apistub_buffer) = epic_usb_cdcacm(
);
break;
case API_WS2812_WRITE:
epic_ws2812_write(
*(uint8_t*)(epc__apistub_buffer + 0),
*(uint8_t **)(epc__apistub_buffer + sizeof(uint8_t)),
*(uint32_t*)(epc__apistub_buffer + sizeof(uint8_t) + sizeof(uint8_t *))
);
break;
default:
/* TODO: Better error handling */
LOG_ERR("api-dispatcher", "API function 0x%lx is unknown!!", id);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment