fix most warnings
This commit is contained in:
parent
c4da02ca2c
commit
00541bd9c5
@ -72,6 +72,7 @@ static void _throw_animation(geomancy_state_t *state);
|
|||||||
// WATCH FACE FUNCTIONS ///////////////////////////////////////////////////////
|
// WATCH FACE FUNCTIONS ///////////////////////////////////////////////////////
|
||||||
|
|
||||||
void geomancy_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
void geomancy_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
|
(void) watch_face_index;
|
||||||
(void) settings;
|
(void) settings;
|
||||||
if (*context_ptr == NULL) {
|
if (*context_ptr == NULL) {
|
||||||
*context_ptr = malloc(sizeof(geomancy_state_t));
|
*context_ptr = malloc(sizeof(geomancy_state_t));
|
||||||
@ -112,12 +113,14 @@ bool geomancy_face_loop(movement_event_t event, movement_settings_t *settings, v
|
|||||||
switch ( state->mode ) {
|
switch ( state->mode ) {
|
||||||
case 0:
|
case 0:
|
||||||
state->mode++;
|
state->mode++;
|
||||||
|
// fall through
|
||||||
case 1:
|
case 1:
|
||||||
state->animate = true;
|
state->animate = true;
|
||||||
state->i_ching_hexagram = _iching_form_hexagram();
|
state->i_ching_hexagram = _iching_form_hexagram();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
state->mode++;
|
state->mode++;
|
||||||
|
// fall through
|
||||||
case 3:
|
case 3:
|
||||||
state->animate = true;
|
state->animate = true;
|
||||||
state->geomantic_figure = _geomancy_pick_figure().bits;
|
state->geomantic_figure = _geomancy_pick_figure().bits;
|
||||||
@ -147,6 +150,7 @@ void geomancy_face_resign(movement_settings_t *settings, void *context) {
|
|||||||
// STATIC FUNCTIONS ///////////////////////////////////////////////////////////
|
// STATIC FUNCTIONS ///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/** @brief display handler */
|
/** @brief display handler */
|
||||||
|
static void geomancy_face_display(geomancy_state_t *state);
|
||||||
static void geomancy_face_display(geomancy_state_t *state) {
|
static void geomancy_face_display(geomancy_state_t *state) {
|
||||||
char token[7] = {0};
|
char token[7] = {0};
|
||||||
nibble_t figure = *((nibble_t*) &state->geomantic_figure);
|
nibble_t figure = *((nibble_t*) &state->geomantic_figure);
|
||||||
@ -287,7 +291,7 @@ static void _throw_animation(geomancy_state_t *state) {
|
|||||||
|
|
||||||
/** @brief form a trigram from three random bit picks
|
/** @brief form a trigram from three random bit picks
|
||||||
*/
|
*/
|
||||||
static tribble_t _iching_pick_trigram() {
|
static tribble_t _iching_pick_trigram(void) {
|
||||||
uint8_t index = (divine_bit() << 2) | (divine_bit() << 1) | divine_bit();
|
uint8_t index = (divine_bit() << 2) | (divine_bit() << 1) | divine_bit();
|
||||||
tribble_t trigram = {(bagua >> (3 * index)) & 0b111};
|
tribble_t trigram = {(bagua >> (3 * index)) & 0b111};
|
||||||
return trigram;
|
return trigram;
|
||||||
@ -295,7 +299,8 @@ static tribble_t _iching_pick_trigram() {
|
|||||||
|
|
||||||
/** @brief form a hexagram from two trigrams
|
/** @brief form a hexagram from two trigrams
|
||||||
*/
|
*/
|
||||||
static uint8_t _iching_form_hexagram() {
|
static uint8_t _iching_form_hexagram(void);
|
||||||
|
static uint8_t _iching_form_hexagram(void) {
|
||||||
tribble_t inner = _iching_pick_trigram();
|
tribble_t inner = _iching_pick_trigram();
|
||||||
tribble_t outer = _iching_pick_trigram();
|
tribble_t outer = _iching_pick_trigram();
|
||||||
uint8_t hexagram = (inner.bits << 3) | outer.bits;
|
uint8_t hexagram = (inner.bits << 3) | outer.bits;
|
||||||
@ -305,6 +310,7 @@ static uint8_t _iching_form_hexagram() {
|
|||||||
/** @brief display hexagram
|
/** @brief display hexagram
|
||||||
* @details | for unbroken lines and Ξ for broken lines, left of display is bottom
|
* @details | for unbroken lines and Ξ for broken lines, left of display is bottom
|
||||||
*/
|
*/
|
||||||
|
static void _display_hexagram(uint8_t hexagram, char* str);
|
||||||
static void _display_hexagram(uint8_t hexagram, char* str) {
|
static void _display_hexagram(uint8_t hexagram, char* str) {
|
||||||
str[6] = '\0'; // Null-terminate the string
|
str[6] = '\0'; // Null-terminate the string
|
||||||
for (uint8_t i = 0; i < 6; i++) {
|
for (uint8_t i = 0; i < 6; i++) {
|
||||||
@ -334,7 +340,8 @@ static void _fix_broken_line(uint8_t hexagram) {
|
|||||||
/** @brief choose a geomantic figure from four random bits
|
/** @brief choose a geomantic figure from four random bits
|
||||||
* @details 0 represents · and 1 represents : counting from the bottom
|
* @details 0 represents · and 1 represents : counting from the bottom
|
||||||
*/
|
*/
|
||||||
static nibble_t _geomancy_pick_figure() {
|
static nibble_t _geomancy_pick_figure(void);
|
||||||
|
static nibble_t _geomancy_pick_figure(void) {
|
||||||
uint8_t index = (divine_bit() << 3) | (divine_bit() << 2) | (divine_bit() << 1) | divine_bit();
|
uint8_t index = (divine_bit() << 3) | (divine_bit() << 2) | (divine_bit() << 1) | divine_bit();
|
||||||
nibble_t figure = {(geomantic >> (4 * (15 - index))) & 0xF};
|
nibble_t figure = {(geomantic >> (4 * (15 - index))) & 0xF};
|
||||||
return figure;
|
return figure;
|
||||||
|
@ -207,7 +207,7 @@ void randonaut_face_resign(movement_settings_t *settings, void *context) {
|
|||||||
/** @brief display handler
|
/** @brief display handler
|
||||||
*/
|
*/
|
||||||
static void _randonaut_face_display(randonaut_state_t *state) {
|
static void _randonaut_face_display(randonaut_state_t *state) {
|
||||||
char buf[11];
|
char buf[12];
|
||||||
watch_clear_colon();
|
watch_clear_colon();
|
||||||
switch ( state->face.mode ) {
|
switch ( state->face.mode ) {
|
||||||
case 0: //home
|
case 0: //home
|
||||||
|
@ -45,6 +45,7 @@ static void _coin_animation(toss_up_state_t *state);
|
|||||||
// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
|
// PUBLIC FUNCTIONS ///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void toss_up_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
void toss_up_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr) {
|
||||||
|
(void) watch_face_index;
|
||||||
(void) settings;
|
(void) settings;
|
||||||
if (*context_ptr == NULL) {
|
if (*context_ptr == NULL) {
|
||||||
*context_ptr = malloc(sizeof(toss_up_state_t));
|
*context_ptr = malloc(sizeof(toss_up_state_t));
|
||||||
@ -95,6 +96,7 @@ bool toss_up_face_loop(movement_event_t event, movement_settings_t *settings, vo
|
|||||||
switch (state->mode) {
|
switch (state->mode) {
|
||||||
case 0:
|
case 0:
|
||||||
state->mode++;
|
state->mode++;
|
||||||
|
// fall through
|
||||||
case 1:
|
case 1:
|
||||||
state->animate = true;
|
state->animate = true;
|
||||||
for (i = 0; i < state->coin_num; i++) {
|
for (i = 0; i < state->coin_num; i++) {
|
||||||
@ -103,6 +105,7 @@ bool toss_up_face_loop(movement_event_t event, movement_settings_t *settings, vo
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
state->mode++;
|
state->mode++;
|
||||||
|
// fall through
|
||||||
case 3:
|
case 3:
|
||||||
state->animate = true;
|
state->animate = true;
|
||||||
for (i = 0; i < state->dice_num; i++) {
|
for (i = 0; i < state->dice_num; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user