adc for random number generation not yet working

This commit is contained in:
2024-03-20 21:56:19 +01:00
parent 8c995f66ff
commit 50486f6ec0
5 changed files with 44 additions and 12 deletions

View File

@ -1,7 +1,9 @@
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include "shapes.h"
#include "myrand.h"
#include "canvas.h"
#include "../rgb-driver/colors.h"
@ -354,16 +356,14 @@ void shapesInit() {
}
void stoneCreate() {
#if 0
static uint8_t cnt = 0;
// static uint8_t cnt = 0;
uint8_t r = myRandGet();
uint8_t cnt = r % e_ShapeInvalid;
stone.shape = ((shape_t[]){ e_I, e_O, e_T, e_Z, e_S, e_L, e_J })[cnt];
cnt++;
if (cnt > 3) {
cnt = 0;
}
#else
stone.shape = e_J;
#endif
// cnt++;
// if (cnt >= e_ShapeInvalid) {
// cnt = 0;
// }
stone.orientation = e_0;
stone.x = 5;
stone.y = 0;