Dependencies:   mbed

fonction.cpp

Committer:
Ridaz
Date:
2015-04-14
Revision:
1:0f2ba28c2e70
Parent:
0:163dfb02ed36

File content as of revision 1:0f2ba28c2e70:

#include "fonction.h"
int bitToInt(int i)
{
    switch (i) {
        case 1:
            return 0;
           // break;
        case 2:
            return 1;
           // break;
        case 4:
            return 2;
           // break;
        case 8:
            return 3;
           // break;
        case 16:
            return 4;
           // break;
        case 32:
            return 5;
           // break;
        case 64:
            return 6;
           // break;
        case 128:
            return 7;
           // break;
        case 256:
            return 8;
           // break;
        case 512:
            return 9;
           // break;
        case 1024:
            return -1;
           // break;
        case 2048:
            return -2;
         //   break;
        default:
            return -3;
    }
}