Commit 26d20f6e authored by Astro's avatar Astro
Browse files

Merge branch 'firmware-1.15+' into 'master'

firmware: update to v1.15 + MAX86150

See merge request !25
parents 18eba092 89593fda
Pipeline #4519 failed with stage
in 13 minutes and 9 seconds
Subproject commit f17417e13cfc6d51ad9e4b66bc0b72b5bd05beea Subproject commit da4bc11fbdded3588a97b1f905da4866a30f520c
...@@ -158,7 +158,7 @@ int epic_read_thermistor_voltage(float *result) ...@@ -158,7 +158,7 @@ int epic_read_thermistor_voltage(float *result)
} }
/* Autogenerated stub for API_UART_WRITE_STR */ /* Autogenerated stub for API_UART_WRITE_STR */
void epic_uart_write_str( const char *str, size_t length ) void epic_uart_write_str( const char *str, size_t length)
{ {
const int epc__apistub_size = sizeof(const char *) + sizeof(size_t); const int epc__apistub_size = sizeof(const char *) + sizeof(size_t);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -215,7 +215,7 @@ uint8_t epic_buttons_read(uint8_t mask) ...@@ -215,7 +215,7 @@ uint8_t epic_buttons_read(uint8_t mask)
} }
/* Autogenerated stub for API_GPIO_SET_PIN_MODE */ /* 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); const int epc__apistub_size = sizeof(uint8_t) + sizeof(uint8_t);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -305,7 +305,7 @@ int epic_leds_get_rgb(int led, uint8_t * rgb) ...@@ -305,7 +305,7 @@ int epic_leds_get_rgb(int led, uint8_t * rgb)
} }
/* Autogenerated stub for API_LEDS_SET_HSV */ /* 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); const int epc__apistub_size = sizeof(int) + sizeof(float) + sizeof(float) + sizeof(float);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -337,7 +337,7 @@ void epic_leds_set_all(uint8_t *pattern, uint8_t len) ...@@ -337,7 +337,7 @@ void epic_leds_set_all(uint8_t *pattern, uint8_t len)
} }
/* Autogenerated stub for API_LEDS_SET_ALL_HSV */ /* 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); const int epc__apistub_size = sizeof(float *) + sizeof(uint8_t);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -352,7 +352,7 @@ void epic_leds_set_all_hsv( float *pattern, uint8_t len ) ...@@ -352,7 +352,7 @@ void epic_leds_set_all_hsv( float *pattern, uint8_t len )
} }
/* Autogenerated stub for API_LEDS_PREP */ /* 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); const int epc__apistub_size = sizeof(int) + sizeof(uint8_t) + sizeof(uint8_t) + sizeof(uint8_t);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -369,7 +369,7 @@ void epic_leds_prep( int led, uint8_t r, uint8_t g, uint8_t b ) ...@@ -369,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 */ /* 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); const int epc__apistub_size = sizeof(int) + sizeof(float) + sizeof(float) + sizeof(float);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -484,7 +484,7 @@ void epic_set_flashlight(_Bool power) ...@@ -484,7 +484,7 @@ void epic_set_flashlight(_Bool power)
} }
/* Autogenerated stub for API_LEDS_SET_GAMMA_TABLE */ /* Autogenerated stub for API_LEDS_SET_GAMMA_TABLE */
void epic_leds_set_gamma_table( uint8_t rgb_channel, uint8_t *gamma_table ) void epic_leds_set_gamma_table( uint8_t rgb_channel, uint8_t *gamma_table)
{ {
const int epc__apistub_size = sizeof(uint8_t) + sizeof(uint8_t *); const int epc__apistub_size = sizeof(uint8_t) + sizeof(uint8_t *);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -499,7 +499,7 @@ void epic_leds_set_gamma_table( uint8_t rgb_channel, uint8_t *gamma_table ) ...@@ -499,7 +499,7 @@ void epic_leds_set_gamma_table( uint8_t rgb_channel, uint8_t *gamma_table )
} }
/* Autogenerated stub for API_LEDS_CLEAR_ALL */ /* 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); const int epc__apistub_size = sizeof(uint8_t) + sizeof(uint8_t) + sizeof(uint8_t);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -541,7 +541,7 @@ int epic_bme680_deinit() ...@@ -541,7 +541,7 @@ int epic_bme680_deinit()
} }
/* Autogenerated stub for API_BME680_GET_DATA */ /* 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 *); const int epc__apistub_size = sizeof(struct bme680_sensor_data *);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -554,8 +554,36 @@ int epic_bme680_read_sensors( struct bme680_sensor_data *data ) ...@@ -554,8 +554,36 @@ int epic_bme680_read_sensors( struct bme680_sensor_data *data )
return *(int*)_api_call_transact(epc__apistub_buffer); return *(int*)_api_call_transact(epc__apistub_buffer);
} }
/* Autogenerated stub for API_MAX86150_ENABLE */
int epic_max86150_enable_sensor(struct max86150_sensor_config *config, size_t config_size)
{
const int epc__apistub_size = sizeof(struct max86150_sensor_config *) + sizeof(size_t);
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_MAX86150_ENABLE, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
*(struct max86150_sensor_config **)(epc__apistub_buffer + 0) = config;
*(size_t*)(epc__apistub_buffer + sizeof(struct max86150_sensor_config *)) = config_size;
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_MAX86150_DISABLE */
int epic_max86150_disable_sensor()
{
const int epc__apistub_size = 0;
void*epc__apistub_buffer;
epc__apistub_buffer = _api_call_start(API_MAX86150_DISABLE, epc__apistub_size);
/* TODO: Check if epc__apistub_buffer is not NULL */
return *(int*)_api_call_transact(epc__apistub_buffer);
}
/* Autogenerated stub for API_PERSONAL_STATE_SET */ /* 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); const int epc__apistub_size = sizeof(uint8_t) + sizeof(_Bool);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -612,7 +640,7 @@ int epic_stream_read(int sd, void *buf, size_t count) ...@@ -612,7 +640,7 @@ int epic_stream_read(int sd, void *buf, size_t count)
} }
/* Autogenerated stub for API_BHI160_ENABLE */ /* Autogenerated stub for API_BHI160_ENABLE */
int epic_bhi160_enable_sensor( enum bhi160_sensor_type sensor_type, struct bhi160_sensor_config *config ) int epic_bhi160_enable_sensor( enum bhi160_sensor_type sensor_type, struct bhi160_sensor_config *config)
{ {
const int epc__apistub_size = sizeof(enum bhi160_sensor_type) + sizeof(struct bhi160_sensor_config *); const int epc__apistub_size = sizeof(enum bhi160_sensor_type) + sizeof(struct bhi160_sensor_config *);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -627,7 +655,7 @@ int epic_bhi160_enable_sensor( enum bhi160_sensor_type sensor_type, struct bhi16 ...@@ -627,7 +655,7 @@ int epic_bhi160_enable_sensor( enum bhi160_sensor_type sensor_type, struct bhi16
} }
/* Autogenerated stub for API_BHI160_DISABLE */ /* Autogenerated stub for API_BHI160_DISABLE */
int epic_bhi160_disable_sensor( enum bhi160_sensor_type sensor_type ) int epic_bhi160_disable_sensor( enum bhi160_sensor_type sensor_type)
{ {
const int epc__apistub_size = sizeof(enum bhi160_sensor_type); const int epc__apistub_size = sizeof(enum bhi160_sensor_type);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -739,7 +767,7 @@ int epic_disp_print( int16_t posx, int16_t posy, const char *pString, uint16_t f ...@@ -739,7 +767,7 @@ int epic_disp_print( int16_t posx, int16_t posy, const char *pString, uint16_t f
} }
/* Autogenerated stub for API_DISP_PRINT_ADV */ /* Autogenerated stub for API_DISP_PRINT_ADV */
int epic_disp_print_adv( uint8_t font, int16_t posx, int16_t posy, const char *pString, uint16_t fg, uint16_t bg ) int epic_disp_print_adv( uint8_t font, int16_t posx, int16_t posy, const char *pString, uint16_t fg, uint16_t bg)
{ {
const int epc__apistub_size = sizeof(uint8_t) + sizeof(int16_t) + sizeof(int16_t) + sizeof(const char *) + sizeof(uint16_t) + sizeof(uint16_t); const int epc__apistub_size = sizeof(uint8_t) + sizeof(int16_t) + sizeof(int16_t) + sizeof(const char *) + sizeof(uint16_t) + sizeof(uint16_t);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -772,7 +800,7 @@ int epic_disp_clear(uint16_t color) ...@@ -772,7 +800,7 @@ int epic_disp_clear(uint16_t color)
} }
/* Autogenerated stub for API_DISP_PIXEL */ /* Autogenerated stub for API_DISP_PIXEL */
int epic_disp_pixel( int16_t x, int16_t y, uint16_t color ) int epic_disp_pixel( int16_t x, int16_t y, uint16_t color)
{ {
const int epc__apistub_size = sizeof(int16_t) + sizeof(int16_t) + sizeof(uint16_t); const int epc__apistub_size = sizeof(int16_t) + sizeof(int16_t) + sizeof(uint16_t);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -788,7 +816,7 @@ int epic_disp_pixel( int16_t x, int16_t y, uint16_t color ) ...@@ -788,7 +816,7 @@ int epic_disp_pixel( int16_t x, int16_t y, uint16_t color )
} }
/* Autogenerated stub for API_DISP_LINE */ /* Autogenerated stub for API_DISP_LINE */
int epic_disp_line( int16_t xstart, int16_t ystart, int16_t xend, int16_t yend, uint16_t color, enum disp_linestyle linestyle, uint16_t pixelsize ) int epic_disp_line( int16_t xstart, int16_t ystart, int16_t xend, int16_t yend, uint16_t color, enum disp_linestyle linestyle, uint16_t pixelsize)
{ {
const int epc__apistub_size = sizeof(int16_t) + sizeof(int16_t) + sizeof(int16_t) + sizeof(int16_t) + sizeof(uint16_t) + sizeof(enum disp_linestyle) + sizeof(uint16_t); const int epc__apistub_size = sizeof(int16_t) + sizeof(int16_t) + sizeof(int16_t) + sizeof(int16_t) + sizeof(uint16_t) + sizeof(enum disp_linestyle) + sizeof(uint16_t);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -808,7 +836,7 @@ int epic_disp_line( int16_t xstart, int16_t ystart, int16_t xend, int16_t yend, ...@@ -808,7 +836,7 @@ int epic_disp_line( int16_t xstart, int16_t ystart, int16_t xend, int16_t yend,
} }
/* Autogenerated stub for API_DISP_RECT */ /* Autogenerated stub for API_DISP_RECT */
int epic_disp_rect( int16_t xstart, int16_t ystart, int16_t xend, int16_t yend, uint16_t color, enum disp_fillstyle fillstyle, uint16_t pixelsize ) int epic_disp_rect( int16_t xstart, int16_t ystart, int16_t xend, int16_t yend, uint16_t color, enum disp_fillstyle fillstyle, uint16_t pixelsize)
{ {
const int epc__apistub_size = sizeof(int16_t) + sizeof(int16_t) + sizeof(int16_t) + sizeof(int16_t) + sizeof(uint16_t) + sizeof(enum disp_fillstyle) + sizeof(uint16_t); const int epc__apistub_size = sizeof(int16_t) + sizeof(int16_t) + sizeof(int16_t) + sizeof(int16_t) + sizeof(uint16_t) + sizeof(enum disp_fillstyle) + sizeof(uint16_t);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -828,7 +856,7 @@ int epic_disp_rect( int16_t xstart, int16_t ystart, int16_t xend, int16_t yend, ...@@ -828,7 +856,7 @@ int epic_disp_rect( int16_t xstart, int16_t ystart, int16_t xend, int16_t yend,
} }
/* Autogenerated stub for API_DISP_CIRC */ /* Autogenerated stub for API_DISP_CIRC */
int epic_disp_circ( int16_t x, int16_t y, uint16_t rad, uint16_t color, enum disp_fillstyle fillstyle, uint16_t pixelsize ) int epic_disp_circ( int16_t x, int16_t y, uint16_t rad, uint16_t color, enum disp_fillstyle fillstyle, uint16_t pixelsize)
{ {
const int epc__apistub_size = sizeof(int16_t) + sizeof(int16_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(enum disp_fillstyle) + sizeof(uint16_t); const int epc__apistub_size = sizeof(int16_t) + sizeof(int16_t) + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(enum disp_fillstyle) + sizeof(uint16_t);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -847,7 +875,7 @@ int epic_disp_circ( int16_t x, int16_t y, uint16_t rad, uint16_t color, enum dis ...@@ -847,7 +875,7 @@ int epic_disp_circ( int16_t x, int16_t y, uint16_t rad, uint16_t color, enum dis
} }
/* Autogenerated stub for API_DISP_FRAMEBUFFER */ /* 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 *); const int epc__apistub_size = sizeof(union disp_framebuffer *);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -928,7 +956,7 @@ uint16_t epic_light_sensor_read(void) ...@@ -928,7 +956,7 @@ uint16_t epic_light_sensor_read(void)
} }
/* Autogenerated stub for API_FILE_OPEN */ /* Autogenerated stub for API_FILE_OPEN */
int epic_file_open( const char* filename, const char* modeString ) int epic_file_open( const char* filename, const char* modeString)
{ {
const int epc__apistub_size = sizeof(const char*) + sizeof(const char*); const int epc__apistub_size = sizeof(const char*) + sizeof(const char*);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -973,7 +1001,7 @@ int epic_file_read(int fd, void* buf, size_t nbytes) ...@@ -973,7 +1001,7 @@ int epic_file_read(int fd, void* buf, size_t nbytes)
} }
/* Autogenerated stub for API_FILE_WRITE */ /* 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); const int epc__apistub_size = sizeof(int) + sizeof(const void*) + sizeof(size_t);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -1033,7 +1061,7 @@ int epic_file_tell(int fd) ...@@ -1033,7 +1061,7 @@ int epic_file_tell(int fd)
} }
/* Autogenerated stub for API_FILE_STAT */ /* Autogenerated stub for API_FILE_STAT */
int epic_file_stat( const char* path, struct epic_stat* stat ) int epic_file_stat( const char* path, struct epic_stat* stat)
{ {
const int epc__apistub_size = sizeof(const char*) + sizeof(struct epic_stat*); const int epc__apistub_size = sizeof(const char*) + sizeof(struct epic_stat*);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -1172,7 +1200,7 @@ uint64_t epic_rtc_get_milliseconds(void) ...@@ -1172,7 +1200,7 @@ uint64_t epic_rtc_get_milliseconds(void)
} }
/* Autogenerated stub for API_RTC_SET_MILLISECONDS */ /* 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); const int epc__apistub_size = sizeof(uint64_t);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -1215,7 +1243,7 @@ int epic_trng_read(uint8_t *dest, size_t size) ...@@ -1215,7 +1243,7 @@ int epic_trng_read(uint8_t *dest, size_t size)
} }
/* Autogenerated stub for API_MAX30001_ENABLE */ /* Autogenerated stub for API_MAX30001_ENABLE */
int epic_max30001_enable_sensor( struct max30001_sensor_config *config ) int epic_max30001_enable_sensor( struct max30001_sensor_config *config)
{ {
const int epc__apistub_size = sizeof(struct max30001_sensor_config *); const int epc__apistub_size = sizeof(struct max30001_sensor_config *);
void*epc__apistub_buffer; void*epc__apistub_buffer;
...@@ -1350,6 +1378,8 @@ void epic_isr_uart_rx(api_int_id_t id) ...@@ -1350,6 +1378,8 @@ void epic_isr_uart_rx(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler"))); __attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_ctrl_c(api_int_id_t id) void epic_isr_ctrl_c(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler"))); __attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_max86150(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_bhi160_accelerometer(api_int_id_t id) void epic_isr_bhi160_accelerometer(api_int_id_t id)
__attribute__((weak, alias("__epic_isr_default_handler"))); __attribute__((weak, alias("__epic_isr_default_handler")));
void epic_isr_bhi160_magnetometer(api_int_id_t id) void epic_isr_bhi160_magnetometer(api_int_id_t id)
...@@ -1394,6 +1424,9 @@ void __dispatch_isr(api_int_id_t id) ...@@ -1394,6 +1424,9 @@ void __dispatch_isr(api_int_id_t id)
case EPIC_INT_CTRL_C: case EPIC_INT_CTRL_C:
epic_isr_ctrl_c(id); epic_isr_ctrl_c(id);
break; break;
case EPIC_INT_MAX86150:
epic_isr_max86150(id);
break;
case EPIC_INT_BHI160_ACCELEROMETER: case EPIC_INT_BHI160_ACCELEROMETER:
epic_isr_bhi160_accelerometer(id); epic_isr_bhi160_accelerometer(id);
break; break;
......
...@@ -212,6 +212,16 @@ void __api_dispatch_call(uint32_t id, void*epc__apistub_buffer) ...@@ -212,6 +212,16 @@ void __api_dispatch_call(uint32_t id, void*epc__apistub_buffer)
*(struct bme680_sensor_data **)(epc__apistub_buffer + 0) *(struct bme680_sensor_data **)(epc__apistub_buffer + 0)
); );
break; break;
case API_MAX86150_ENABLE:
*((int*)epc__apistub_buffer) = epic_max86150_enable_sensor(
*(struct max86150_sensor_config **)(epc__apistub_buffer + 0),
*(size_t*)(epc__apistub_buffer + sizeof(struct max86150_sensor_config *))
);
break;
case API_MAX86150_DISABLE:
*((int*)epc__apistub_buffer) = epic_max86150_disable_sensor(
);
break;
case API_PERSONAL_STATE_SET: case API_PERSONAL_STATE_SET:
*((int*)epc__apistub_buffer) = epic_personal_state_set( *((int*)epc__apistub_buffer) = epic_personal_state_set(
*(uint8_t*)(epc__apistub_buffer + 0), *(uint8_t*)(epc__apistub_buffer + 0),
......
Markdown is supported
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