Added some comments

This commit is contained in:
francescobarbarulo 2019-04-12 17:50:48 +02:00
parent f8fe30f0ef
commit e7bf80de71

View File

@ -45,6 +45,7 @@
#define LOG_MODULE "App" #define LOG_MODULE "App"
#define LOG_LEVEL LOG_LEVEL_INFO #define LOG_LEVEL LOG_LEVEL_INFO
// !! TO INIT WITH CART MAC ADDRESS !! //
static linkaddr_t dest_addr = {{0x00, 0x12, 0x4b, 0x00, 0x0f, 0x82, 0x18, 0x04}}; static linkaddr_t dest_addr = {{0x00, 0x12, 0x4b, 0x00, 0x0f, 0x82, 0x18, 0x04}};
@ -76,13 +77,12 @@ void scan_product(struct Product *p){
PROCESS_THREAD(product_proc, ev, data){ PROCESS_THREAD(product_proc, ev, data){
PROCESS_BEGIN(); PROCESS_BEGIN();
// init random number generator // init random number generator
unsigned int magic_seed = 12; unsigned int magic_seed = 12; // oooh :o
srand(magic_seed); srand(magic_seed);
while(1) { while(1) {
PROCESS_YIELD(); PROCESS_YIELD();
if (ev == button_hal_press_event){ if (ev == button_hal_press_event){
// product generation // product generation
unsigned int index = rand() % 3; unsigned int index = rand() % 3;
scan_product(&product_list[index]); scan_product(&product_list[index]);